node: fix throws before timer module is loaded

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: https://github.com/joyent/node/pull/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>
This commit is contained in:
Trevor Norris 2014-11-12 16:35:48 -08:00 committed by Bert Belder
parent a1da024cab
commit 8f41db6104

View File

@ -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;