mirror of https://github.com/lukechilds/node.git
Browse Source
This commit fixes a regression introduced in 0ed8839a27
that caused
additional queued immediate callbacks to be ignored if
`clearImmediate(immediate)` was called within the callback for
`immediate`.
PR-URL: https://github.com/nodejs/node/pull/9086
Fixes: https://github.com/nodejs/node/issues/9084
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
v7.x
Brian White
8 years ago
committed by
James M Snell
2 changed files with 28 additions and 1 deletions
@ -0,0 +1,18 @@ |
|||
'use strict'; |
|||
require('../common'); |
|||
const assert = require('assert'); |
|||
|
|||
const N = 3; |
|||
var count = 0; |
|||
function next() { |
|||
const immediate = setImmediate(function() { |
|||
clearImmediate(immediate); |
|||
++count; |
|||
}); |
|||
} |
|||
for (var i = 0; i < N; ++i) |
|||
next(); |
|||
|
|||
process.on('exit', () => { |
|||
assert.strictEqual(count, N, `Expected ${N} immediate callback executions`); |
|||
}); |
Loading…
Reference in new issue