From 69714ab1c44f45f7949484ab7f4574f3ad9894ce Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 8 Feb 2019 11:22:37 +0800 Subject: process: normalize process.argv before user code execution And make sure that `process.argv` from the preloaded modules is the same as the one in the main module. Refs: https://github.com/nodejs/node/issues/25967 PR-URL: https://github.com/nodejs/node/pull/26000 Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Minwoo Jung --- lib/internal/main/run_main_module.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/internal/main/run_main_module.js') diff --git a/lib/internal/main/run_main_module.js b/lib/internal/main/run_main_module.js index 97a4e33be2..634abe493e 100644 --- a/lib/internal/main/run_main_module.js +++ b/lib/internal/main/run_main_module.js @@ -4,12 +4,12 @@ const { prepareMainThreadExecution } = require('internal/bootstrap/pre_execution'); -prepareMainThreadExecution(); - // Expand process.argv[1] into a full path. const path = require('path'); process.argv[1] = path.resolve(process.argv[1]); +prepareMainThreadExecution(); + const CJSModule = require('internal/modules/cjs/loader'); markBootstrapComplete(); -- cgit v1.2.3