diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-12-03 20:11:29 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2019-12-09 12:23:08 +0300 |
commit | 325128e469229a35f2c805ef18970a2cffb64831 (patch) | |
tree | 0020fec9b1de3fa8a116ccfb56083585cb0429e8 /src | |
parent | 5067463f3c3235fd25941afc1e6b6510c359da0f (diff) |
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.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/node_config.cc b/src/node_config.cc index 16050bdd5b9..6ee3164a134 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 |