mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
566 B
24 lines
566 B
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
let mainFinished = false;
|
|
|
|
setImmediate(common.mustCall(function() {
|
|
assert.strictEqual(mainFinished, true);
|
|
clearImmediate(immediateB);
|
|
}));
|
|
|
|
let immediateB = setImmediate(function() {
|
|
common.fail('this immediate should not run');
|
|
});
|
|
|
|
setImmediate(common.mustCall((...args) => {
|
|
assert.deepStrictEqual(args, [1, 2, 3]);
|
|
}), 1, 2, 3);
|
|
|
|
setImmediate(common.mustCall((...args) => {
|
|
assert.deepStrictEqual(args, [1, 2, 3, 4, 5]);
|
|
}), 1, 2, 3, 4, 5);
|
|
|
|
mainFinished = true;
|
|
|