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/parallel/test-async-hooks-run-in-async-scope-caught-exception.js

10 lines
245 B
JavaScript
Raw Normal View History

async_hooks: ensure event after been emitted on runInAsyncScope The exception handler user-defined will not automatically emit after for the async resource. Also removes a duplicated case `test-emit-after-uncaught-exception-runInAsyncScope.js` which is identical to test-emit-after-uncaught-exception.js. Refs: https://github.com/nodejs/node/pull/30965 PR-URL: https://github.com/nodejs/node/pull/31784 Fixes: https://github.com/nodejs/node/issues/31783 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-14 11:30:33 +08:00
'use strict';
require('../common');
const { AsyncResource } = require('async_hooks');
try {
new AsyncResource('foo').runInAsyncScope(() => { throw new Error('bar'); });
} catch {}
// Should abort (fail the case) if async id is not matching.
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 1269ms 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