diff options
Diffstat (limited to 'node_modules/inflight')
-rw-r--r-- | node_modules/inflight/inflight.js | 34 | ||||
-rw-r--r-- | node_modules/inflight/package.json | 108 |
2 files changed, 37 insertions, 105 deletions
diff --git a/node_modules/inflight/inflight.js b/node_modules/inflight/inflight.js index 8bc96cbd3..48202b3ca 100644 --- a/node_modules/inflight/inflight.js +++ b/node_modules/inflight/inflight.js @@ -19,18 +19,28 @@ function makeres (key) { var cbs = reqs[key] var len = cbs.length var args = slice(arguments) - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } } }) } diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json index 362a49ee1..6084d3509 100644 --- a/node_modules/inflight/package.json +++ b/node_modules/inflight/package.json @@ -1,107 +1,29 @@ { - "_args": [ - [ - { - "raw": "inflight@^1.0.4", - "scope": null, - "escapedName": "inflight", - "name": "inflight", - "rawSpec": "^1.0.4", - "spec": ">=1.0.4 <2.0.0", - "type": "range" - }, - "/home/dold/repos/taler/wallet-webex/node_modules/glob" - ] - ], - "_from": "inflight@>=1.0.4 <2.0.0", - "_id": "inflight@1.0.5", - "_inCache": true, - "_location": "/inflight", - "_nodeVersion": "5.10.1", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/inflight-1.0.5.tgz_1463529611443_0.00041943578980863094" - }, - "_npmUser": { - "name": "zkat", - "email": "kat@sykosomatic.org" - }, - "_npmVersion": "3.9.1", - "_phantomChildren": {}, - "_requested": { - "raw": "inflight@^1.0.4", - "scope": null, - "escapedName": "inflight", - "name": "inflight", - "rawSpec": "^1.0.4", - "spec": ">=1.0.4 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/glob", - "/glob-stream/glob", - "/vinyl-fs/glob" + "name": "inflight", + "version": "1.0.6", + "description": "Add callbacks to requests in flight to avoid async duplication", + "main": "inflight.js", + "files": [ + "inflight.js" ], - "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", - "_shasum": "db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a", - "_shrinkwrap": null, - "_spec": "inflight@^1.0.4", - "_where": "/home/dold/repos/taler/wallet-webex/node_modules/glob", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/inflight/issues" - }, "dependencies": { "once": "^1.3.0", "wrappy": "1" }, - "description": "Add callbacks to requests in flight to avoid async duplication", "devDependencies": { - "tap": "^1.2.0" + "tap": "^7.1.2" }, - "directories": {}, - "dist": { - "shasum": "db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a", - "tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz" + "scripts": { + "test": "tap test.js --100" }, - "files": [ - "inflight.js" - ], - "gitHead": "559e37b4f6327fca797fe8d7fe8ed6d9cae08821", - "homepage": "https://github.com/isaacs/inflight", - "license": "ISC", - "main": "inflight.js", - "maintainers": [ - { - "name": "iarna", - "email": "me@re-becca.org" - }, - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - { - "name": "zkat", - "email": "kat@sykosomatic.org" - } - ], - "name": "inflight", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", - "url": "git+https://github.com/npm/inflight.git" + "url": "https://github.com/npm/inflight.git" }, - "scripts": { - "test": "tap test.js" + "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" }, - "version": "1.0.5" + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC" } |