Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 812e0b0

Browse filesBrowse files
Trottaddaleax
authored andcommitted
test: refactor async-hooks test-callback-error
Two child processes have their logic in a switch statement and a third uses an `if` statement to detect it. Move all three child process tasks into switch statement. PR-URL: #13554 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: David Cai <davidcai1993@yahoo.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
1 parent 00d2f7c commit 812e0b0
Copy full SHA for 812e0b0

File tree

Expand file treeCollapse file tree

1 file changed

+7
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-8
lines changed
Open diff view settings
Collapse file

‎test/async-hooks/test-callback-error.js‎

Copy file name to clipboardExpand all lines: test/async-hooks/test-callback-error.js
+7-8Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@ switch (process.argv[2]) {
2424
async_hooks.triggerId());
2525
async_hooks.emitBefore(async_hooks.currentId());
2626
break;
27-
}
28-
29-
if (process.execArgv.includes('--abort-on-uncaught-exception')) {
30-
initHooks({
31-
oninit: common.mustCall(() => { throw new Error('test_callback_abort'); })
32-
}).enable();
27+
case 'test_callback_abort':
28+
initHooks({
29+
oninit: common.mustCall(() => { throw new Error('test_callback_abort'); })
30+
}).enable();
3331

34-
async_hooks.emitInit(async_hooks.currentId(), 'test_callback_abort',
35-
async_hooks.triggerId());
32+
async_hooks.emitInit(async_hooks.currentId(), 'test_callback_abort',
33+
async_hooks.triggerId());
34+
break;
3635
}
3736

3837
const c1 = spawnSync(`${process.execPath}`, [__filename, 'test_init_callback']);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.