summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-12-04 01:11:29 +0800
committerRich Trott <rtrott@gmail.com>2019-12-05 10:31:44 -0800
commit28efa4fe953c0da6be25cd10e708b84deaada15f (patch)
treed6ae76a768589e6b4e10ac8cc67293242ee74b7c /src
parent7113d999dcb7e93ac1504f3ae622df61a9495a1c (diff)
downloadandroid-node-v8-28efa4fe953c0da6be25cd10e708b84deaada15f.tar.gz
android-node-v8-28efa4fe953c0da6be25cd10e708b84deaada15f.tar.bz2
android-node-v8-28efa4fe953c0da6be25cd10e708b84deaada15f.zip
lib: delay access to CLI option to pre-execution
CLI options should not be added through the config binding, instead they are already available in the JS land via `require('internal/options')`. Also CLI options in principle should be processed in pre-execution instead of bootstrap scripts. PR-URL: https://github.com/nodejs/node/pull/30778 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/node_config.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/node_config.cc b/src/node_config.cc
index 16050bdd5b..6ee3164a13 100644
--- a/src/node_config.cc
+++ b/src/node_config.cc
@@ -15,11 +15,14 @@ using v8::Number;
using v8::Object;
using v8::Value;
-// The config binding is used to provide an internal view of compile or runtime
+// The config binding is used to provide an internal view of compile time
// config options that are required internally by lib/*.js code. This is an
// alternative to dropping additional properties onto the process object as
// has been the practice previously in node.cc.
+// Command line arguments are already accessible in the JS land via
+// require('internal/options').getOptionValue('--some-option'). Do not add them
+// here.
static void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
@@ -84,9 +87,6 @@ static void Initialize(Local<Object> target,
READONLY_PROPERTY(target, "hasCachedBuiltins",
v8::Boolean::New(isolate, native_module::has_code_cache));
-
- if (env->options()->experimental_wasi)
- READONLY_TRUE_PROPERTY(target, "experimentalWasi");
} // InitConfig
} // namespace node