mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
51783320a4
Today, the global uncaught exception handler is the only place where asyncId 0 is not ignored and we still proceed to call emitAfter. This would've already failed one of our correctness tests in async_hooks if not for some other code meant to handle a different edge case. Fixes: https://github.com/nodejs/node/issues/22982 PR-URL: https://github.com/nodejs/node/pull/41424 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
18 lines
288 B
JavaScript
18 lines
288 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const initHooks = require('./init-hooks');
|
|
|
|
const hooks = initHooks();
|
|
hooks.enable();
|
|
|
|
setImmediate(() => {
|
|
throw new Error();
|
|
});
|
|
|
|
setTimeout(() => {
|
|
throw new Error();
|
|
}, 1);
|
|
|
|
process.on('uncaughtException', common.mustCall(2));
|