Projects
Mega:23.09
nodejs-inflight
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
_service:tar_scm:nodejs-inflight.spec
Changed
@@ -3,7 +3,7 @@ %{?nodejs_find_provides_and_requires} %global enable_tests 1 Name: %{?scl_prefix}nodejs-inflight -Version: 1.0.4 +Version: 1.0.6 Release: 1 Summary: Node.js inflight License: ISC @@ -44,5 +44,8 @@ %{nodejs_sitelib}/inflight %changelog +* Wed Nov 01 2023 xu_ping <707078654@qq.com> - 1.0.6-1 +- Upgrade version to 1.0.6 + * Thu Aug 20 2020 wangxiao <wangxiao65@huawei.com> - 1.0.4-1 - Package init
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="url">git@gitee.com:src-openeuler/nodejs-inflight.git</param> <param name="scm">git</param> - <param name="revision">openEuler-23.09</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:inflight-1.0.4.tgz/.eslintrc
Deleted
@@ -1,17 +0,0 @@ -{ - "env" : { - "node" : true - }, - "rules" : { - "semi": 2, "never", - "strict": 0, - "quotes": 1, "single", "avoid-escape", - "no-use-before-define": 0, - "curly": 0, - "no-underscore-dangle": 0, - "no-lonely-if": 1, - "no-unused-vars": 2, {"vars" : "all", "args" : "after-used"}, - "no-mixed-requires": 0, - "space-infix-ops": 0 - } -}
View file
_service:tar_scm:inflight-1.0.4.tgz/test.js
Deleted
@@ -1,97 +0,0 @@ -var test = require('tap').test -var inf = require('./inflight.js') - - -function req (key, cb) { - cb = inf(key, cb) - if (cb) setTimeout(function () { - cb(key) - cb(key) - }) - return cb -} - -test('basic', function (t) { - var calleda = false - var a = req('key', function (k) { - t.notOk(calleda) - calleda = true - t.equal(k, 'key') - if (calledb) t.end() - }) - t.ok(a, 'first returned cb function') - - var calledb = false - var b = req('key', function (k) { - t.notOk(calledb) - calledb = true - t.equal(k, 'key') - if (calleda) t.end() - }) - - t.notOk(b, 'second should get falsey inflight response') -}) - -test('timing', function (t) { - var expect = - 'method one', - 'start one', - 'end one', - 'two', - 'tick', - 'three' - - var i = 0 - - function log (m) { - t.equal(m, expecti, m + ' === ' + expecti) - ++i - if (i === expect.length) - t.end() - } - - function method (name, cb) { - log('method ' + name) - process.nextTick(cb) - } - - var one = inf('foo', function () { - log('start one') - var three = inf('foo', function () { - log('three') - }) - if (three) method('three', three) - log('end one') - }) - - method('one', one) - - var two = inf('foo', function () { - log('two') - }) - if (two) method('one', two) - - process.nextTick(log.bind(null, 'tick')) -}) - -test('parameters', function (t) { - t.plan(8) - - var a = inf('key', function (first, second, third) { - t.equal(first, 1) - t.equal(second, 2) - t.equal(third, 3) - }) - t.ok(a, 'first returned cb function') - - var b = inf('key', function (first, second, third) { - t.equal(first, 1) - t.equal(second, 2) - t.equal(third, 3) - }) - t.notOk(b, 'second should get falsey inflight response') - - setTimeout(function () { - a(1, 2, 3) - }) -})
View file
_service:tar_scm:inflight-1.0.4.tgz/inflight.js -> _service:tar_scm:inflight-1.0.6.tgz/inflight.js
Changed
@@ -19,18 +19,28 @@ var cbs = reqskey var len = cbs.length var args = slice(arguments) - for (var i = 0; i < len; i++) { - cbsi.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 reqskey + + // 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++) { + cbsi.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 reqskey + } } }) }
View file
_service:tar_scm:inflight-1.0.4.tgz/package.json -> _service:tar_scm:inflight-1.0.6.tgz/package.json
Changed
@@ -1,21 +1,24 @@ { "name": "inflight", - "version": "1.0.4", + "version": "1.0.6", "description": "Add callbacks to requests in flight to avoid async duplication", "main": "inflight.js", + "files": + "inflight.js" + , "dependencies": { "once": "^1.3.0", "wrappy": "1" }, "devDependencies": { - "tap": "^0.4.10" + "tap": "^7.1.2" }, "scripts": { - "test": "tap test.js" + "test": "tap test.js --100" }, "repository": { "type": "git", - "url": "git://github.com/isaacs/inflight" + "url": "https://github.com/npm/inflight.git" }, "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", "bugs": {
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2