-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: #30965 PR-URL: #31784 Fixes: #31783 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
- Loading branch information
1 parent
0654e67
commit a840e9d
Showing
3 changed files
with
19 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
test/parallel/test-async-hooks-run-in-async-scope-caught-exception.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'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. |
40 changes: 0 additions & 40 deletions
40
test/parallel/test-emit-after-uncaught-exception-runInAsyncScope.js
This file was deleted.
Oops, something went wrong.