mirror of https://github.com/lukechilds/node.git
Browse Source
If current immediate has no callback, move on to the next one in the queue. Fixes: https://github.com/nodejs/node/issues/9756 PR-URL: https://github.com/nodejs/node/pull/9759 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>v6
committed by
Jeremiah Senkpiel
2 changed files with 26 additions and 1 deletions
@ -0,0 +1,23 @@ |
|||||
|
'use strict'; |
||||
|
const common = require('../common'); |
||||
|
|
||||
|
// This test ensures that if an Immediate callback clears subsequent
|
||||
|
// immediates we don't get stuck in an infinite loop.
|
||||
|
//
|
||||
|
// If the process does get stuck, it will be timed out by the test
|
||||
|
// runner.
|
||||
|
//
|
||||
|
// Ref: https://github.com/nodejs/node/issues/9756
|
||||
|
|
||||
|
setImmediate(common.mustCall(function() { |
||||
|
clearImmediate(i2); |
||||
|
clearImmediate(i3); |
||||
|
})); |
||||
|
|
||||
|
const i2 = setImmediate(function() { |
||||
|
common.fail('immediate callback should not have fired'); |
||||
|
}); |
||||
|
|
||||
|
const i3 = setImmediate(function() { |
||||
|
common.fail('immediate callback should not have fired'); |
||||
|
}); |
Loading…
Reference in new issue