Skip to content

Commit

Permalink
handle_process_exit.js
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffreyBooth committed Sep 12, 2023
1 parent 0438a5d commit c8be6a5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/internal/modules/esm/handle_process_exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

const { exitCodes: { kUnfinishedTopLevelAwait } } = internalBinding('errors');

// Handle a Promise from running code that potentially does Top-Level Await.
// In that case, it makes sense to set the exit code to a specific non-zero
// value if the main code never finishes running.
/**
* Handle a Promise from running code that potentially does Top-Level Await.
* In that case, it makes sense to set the exit code to a specific non-zero value
* if the main code never finishes running.
*/
function handleProcessExit() {
process.exitCode ??= kUnfinishedTopLevelAwait;
}
Expand Down

0 comments on commit c8be6a5

Please sign in to comment.