2016-11-23 10:57:49 +00:00
|
|
|
'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);
|
|
|
|
}));
|
|
|
|
|
2017-02-03 14:54:19 -05:00
|
|
|
const i2 = setImmediate(common.mustNotCall());
|
2016-11-23 10:57:49 +00:00
|
|
|
|
2017-02-03 14:54:19 -05:00
|
|
|
const i3 = setImmediate(common.mustNotCall());
|