Commit d7bb21f 1 parent d58b5b9 commit d7bb21f Copy full SHA for d7bb21f
File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ // Handle a Promise from running code that potentially does Top-Level Await.
4
+ // In that case, it makes sense to set the exit code to a specific non-zero
5
+ // value if the main code never finishes running.
6
+ // The original purpose was https://github.com/nodejs/node/pull/34640
3
7
function handleProcessExit ( ) {
4
8
process . exitCode ??= 13 ;
5
9
}
Original file line number Diff line number Diff line change @@ -56,9 +56,6 @@ function runMainESM(mainPath) {
56
56
}
57
57
58
58
async function handleMainPromise ( promise ) {
59
- // Handle a Promise from running code that potentially does Top-Level Await.
60
- // In that case, it makes sense to set the exit code to a specific non-zero
61
- // value if the main code never finishes running.
62
59
process . on ( 'exit' , handleProcessExit ) ;
63
60
try {
64
61
return await promise ;
You can’t perform that action at this time.
0 commit comments