Skip to content

Commit d7bb21f

Browse files
committed
move comment to handle_process_exit file
1 parent d58b5b9 commit d7bb21f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/internal/modules/esm/handle_process_exit.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
'use strict';
22

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
37
function handleProcessExit() {
48
process.exitCode ??= 13;
59
}

lib/internal/modules/run_main.js

-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ function runMainESM(mainPath) {
5656
}
5757

5858
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.
6259
process.on('exit', handleProcessExit);
6360
try {
6461
return await promise;

0 commit comments

Comments
 (0)