Test case showing a bug in nextTick ordering
nextTick should fire before setTimeout in this test, but it doesn't.
This commit is contained in:
parent
1d0fb850d9
commit
cf4b5fc52a
17
test/simple/test-next-tick-ordering2.js
Normal file
17
test/simple/test-next-tick-ordering2.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
common = require("../common");
|
||||||
|
assert = common.assert
|
||||||
|
|
||||||
|
var order = [];
|
||||||
|
process.nextTick(function () {
|
||||||
|
process.nextTick(function() {
|
||||||
|
order.push('nextTick');
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
order.push('setTimeout');
|
||||||
|
}, 0);
|
||||||
|
})
|
||||||
|
|
||||||
|
process.addListener('exit', function () {
|
||||||
|
assert.deepEqual(order, ['nextTick', 'setTimeout']);
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user