mirror of https://github.com/nodejs/node.git
nextTick: explicitly no-op when _exiting
parent
4e5fe2d45a
commit
19ecc17e6b
src
test/simple
|
@ -309,6 +309,10 @@
|
|||
};
|
||||
|
||||
process.nextTick = function(callback) {
|
||||
// on the way out, don't bother.
|
||||
// it won't get fired anyway.
|
||||
if (process._exiting) return;
|
||||
|
||||
var tock = { callback: callback };
|
||||
if (process.domain) tock.domain = process.domain;
|
||||
nextTickQueue.push(tock);
|
||||
|
|
|
@ -44,7 +44,9 @@ process.nextTick(function() {
|
|||
complete++;
|
||||
});
|
||||
|
||||
|
||||
process.on('exit', function() {
|
||||
assert.equal(5, complete);
|
||||
process.nextTick(function() {
|
||||
throw new Error('this should not occur');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue