Skip to content

Commit

Permalink
node: fix throws before timer module is loaded
Browse files Browse the repository at this point in the history
An edge case could occur when the setImmediate() in _fatalException()
would fire before the timers module had been loaded globally, causing
Node to crash.

PR-URL: nodejs/node-v0.x-archive#8110
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
  • Loading branch information
trevnorris authored and piscisaureus committed Dec 9, 2014
1 parent 9d0cef4 commit a0e9ca6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@

// if we handled an error, then make sure any ticks get processed
} else {
var t = setImmediate(process._tickCallback);
NativeModule.require('timers').setImmediate(process._tickCallback);
}

return caught;
Expand Down

0 comments on commit a0e9ca6

Please sign in to comment.