Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2022-03-26 16:04:41 +0300
committerJoyee Cheung <joyeec9h3@gmail.com>2022-03-31 14:29:23 +0300
commit73194197875098843f88a5c5fa1f3ba628d66af0 (patch)
treed2d33ef221b0fdc12ffab2a15f6bf5ea134a4435 /lib
parent01f6b9543f8a0c7db20c9e2871f4f794b950698e (diff)
bootstrap: reset process._exit and process.exitCode in pre-execution
PR-URL: https://github.com/nodejs/node/pull/42466 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/bootstrap/pre_execution.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
index 3ef1bca0d4f..b64dfaf980f 100644
--- a/lib/internal/bootstrap/pre_execution.js
+++ b/lib/internal/bootstrap/pre_execution.js
@@ -111,6 +111,9 @@ function patchProcessObject(expandArgv1) {
configurable: getOptionValue('--build-snapshot'),
value: process.argv[0]
});
+
+ process.exitCode = undefined;
+ process._exiting = false;
process.argv[0] = process.execPath;
if (expandArgv1 && process.argv[1] &&