mirror of https://github.com/lukechilds/node.git
Browse Source
PR-URL: https://github.com/nodejs/node/pull/12598 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>v7.x
Zahidul Islam
8 years ago
committed by
Evan Lucas
1 changed files with 7 additions and 12 deletions
@ -1,18 +1,13 @@ |
|||
'use strict'; |
|||
require('../common'); |
|||
const assert = require('assert'); |
|||
const common = require('../common'); |
|||
|
|||
const N = 3; |
|||
let count = 0; |
|||
|
|||
function next() { |
|||
const immediate = setImmediate(function() { |
|||
clearImmediate(immediate); |
|||
++count; |
|||
}); |
|||
const fn = common.mustCall(() => clearImmediate(immediate)); |
|||
const immediate = setImmediate(fn); |
|||
} |
|||
for (let i = 0; i < N; ++i) |
|||
next(); |
|||
|
|||
process.on('exit', () => { |
|||
assert.strictEqual(count, N, `Expected ${N} immediate callback executions`); |
|||
}); |
|||
for (let i = 0; i < N; i++) { |
|||
next(); |
|||
} |
|||
|
Loading…
Reference in new issue