mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 16:34:41 +00:00

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>
10 lines
245 B
JavaScript
10 lines
245 B
JavaScript
'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.
|