Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/npm.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-01-19 22:28:37 +0300
committerisaacs <i@izs.me>2011-01-19 22:28:37 +0300
commita983c81e4b1c2e0e157d57b5de3433b409c426ff (patch)
treec62acbc42aa2f205053da53f91c00b37af54bab2 /npm.js
parent6f550b772cb902887f649b5e3b6aa888bb3b9ff0 (diff)
More efficient multi-load prevention
Diffstat (limited to 'npm.js')
-rw-r--r--npm.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/npm.js b/npm.js
index c3e2c7b24..1fcec9678 100644
--- a/npm.js
+++ b/npm.js
@@ -126,9 +126,10 @@ npm.load = function (conf, cb_) {
loading = true
function cb (er) {
loaded = true
- while (loadListeners.length > 0) {
- loadListeners.shift()(er, npm)
- }
+ loadListeners.forEach(function (cb) {
+ process.nextTick(function () { cb(er, npm) })
+ })
+ loadListeners.length = 0
}
log.waitForConfig()
which(process.argv[0], function (er, node) {