Skip to content

Commit

Permalink
Replace vague 'may not' with definitive 'will not'
Browse files Browse the repository at this point in the history
This vagueness of 'may' has caused a great deal of confusion.
See https://stackoverflow.com/questions/8887318

PR-URL: #23143
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
Mike MacCana authored and trivikr committed Oct 1, 2018
1 parent 639ec83 commit a82ac6e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,11 @@ Modules are cached after the first time they are loaded. This means
(among other things) that every call to `require('foo')` will get
exactly the same object returned, if it would resolve to the same file.

Multiple calls to `require('foo')` may not cause the module code to be
executed multiple times. This is an important feature. With it,
"partially done" objects can be returned, thus allowing transitive
dependencies to be loaded even when they would cause cycles.
Provided `require.cache` is not modified, multiple calls to
`require('foo')` will not cause the module code to be executed multiple times.
This is an important feature. With it, "partially done" objects can be returned,
thus allowing transitive dependencies to be loaded even when they would cause
cycles.

To have a module execute code multiple times, export a function, and call
that function.
Expand Down

2 comments on commit a82ac6e

@jasnell
Copy link
Member

@jasnell jasnell commented on a82ac6e Oct 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trivikr ... just a note: this did not land with the proper subsystem prefix in the commit log message.

@trivikr
Copy link
Member

@trivikr trivikr commented on a82ac6e Oct 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasnell Oops! My bad.
I've created an issue nodejs/node-core-utils#283 for follow-up

Please sign in to comment.