Skip to content

Commit dacfa8d

Browse files
authored
Merge pull request #24 from node-machine/setTimeout-fix
Change setTimeout to setImmediate
2 parents d690dd5 + 603dfd4 commit dacfa8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/private/intercept-exit-callbacks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ module.exports = function interceptExitCallbacks (callbacks, _cache, hash, liveM
167167
if (liveMachine._runningSynchronously) {
168168
return proceed();
169169
}
170-
setTimeout(function (){
170+
setImmediate(function (){
171171
return proceed();
172-
}, 0);
172+
});
173173

174174
})(function afterMaybeWaiting() {
175175

@@ -244,7 +244,7 @@ module.exports = function interceptExitCallbacks (callbacks, _cache, hash, liveM
244244
// ===================================================================================================================
245245
if (liveMachine._doAlterStack) {
246246
// Finally, copy the stack from `thisStack` created at the
247-
// beginning of this function _before_ the setTimeout().
247+
// beginning of this function _before_ the setImmediate().
248248

249249
// Set the new error's stack to that of `thisStack`, with the error message prepended.
250250
// We prepend the message because the code below that modifies the stack expects

0 commit comments

Comments
 (0)