mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
Due to a bug in top-level await implementation, it used to default to exit code 13. PR-URL: https://github.com/nodejs/node/pull/41388 Fixes: https://github.com/nodejs/node/issues/40808 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
13 lines
322 B
JavaScript
13 lines
322 B
JavaScript
'use strict';
|
|
|
|
// 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 ??= 13;
|
|
}
|
|
|
|
module.exports = {
|
|
handleProcessExit,
|
|
};
|