Logo
Explore Help
Sign In
1berry/nodejs
1
0
Fork 0
You've already forked nodejs
Code Issues Packages Projects Releases Wiki Activity
nodejs/test/async-hooks/test-unhandled-exception-valid-ids.js

18 lines
288 B
JavaScript
Raw Permalink Normal View History

process: ignore asyncId 0 in exception handler 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>
2022-01-06 22:04:30 -08:00
'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));
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 413ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API