Skip to content

Commit 8f41db6

Browse files
trevnorrispiscisaureus
authored andcommitted
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: 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>
1 parent a1da024 commit 8f41db6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255

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

261261
return caught;

0 commit comments

Comments
 (0)