summaryrefslogtreecommitdiff
path: root/src/node.cc
diff options
context:
space:
mode:
authorShelley Vohr <shelley.vohr@gmail.com>2019-11-13 15:53:19 +0000
committerShelley Vohr <shelley.vohr@gmail.com>2019-11-18 09:45:36 -0800
commit0f58bfd0633e357208822a1bc045c5e3bbbb3f6e (patch)
treeddc36517237c98dbe563fc374139a205610fbd6e /src/node.cc
parent70281ce1f0598822d536a8c80c1a2b8fdfcd2a63 (diff)
downloadandroid-node-v8-0f58bfd0633e357208822a1bc045c5e3bbbb3f6e.tar.gz
android-node-v8-0f58bfd0633e357208822a1bc045c5e3bbbb3f6e.tar.bz2
android-node-v8-0f58bfd0633e357208822a1bc045c5e3bbbb3f6e.zip
src: expose ability to set options
PR-URL: https://github.com/nodejs/node/pull/30466 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node.cc')
-rw-r--r--src/node.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/node.cc b/src/node.cc
index 5379b42b57..91f07e447f 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -123,8 +123,6 @@
namespace node {
using native_module::NativeModuleEnv;
-using options_parser::kAllowedInEnvironment;
-using options_parser::kDisallowedInEnvironment;
using v8::Boolean;
using v8::EscapableHandleScope;
@@ -679,7 +677,7 @@ void ResetStdio() {
int ProcessGlobalArgs(std::vector<std::string>* args,
std::vector<std::string>* exec_args,
std::vector<std::string>* errors,
- bool is_env) {
+ OptionEnvvarSettings settings) {
// Parse a few arguments which are specific to Node.
std::vector<std::string> v8_args;
@@ -689,7 +687,7 @@ int ProcessGlobalArgs(std::vector<std::string>* args,
exec_args,
&v8_args,
per_process::cli_options.get(),
- is_env ? kAllowedInEnvironment : kDisallowedInEnvironment,
+ settings,
errors);
if (!errors->empty()) return 9;
@@ -851,12 +849,18 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
return 9;
}
- const int exit_code = ProcessGlobalArgs(&env_argv, nullptr, errors, true);
+ const int exit_code = ProcessGlobalArgs(&env_argv,
+ nullptr,
+ errors,
+ kAllowedInEnvironment);
if (exit_code != 0) return exit_code;
}
#endif
- const int exit_code = ProcessGlobalArgs(argv, exec_argv, errors, false);
+ const int exit_code = ProcessGlobalArgs(argv,
+ exec_argv,
+ errors,
+ kDisallowedInEnvironment);
if (exit_code != 0) return exit_code;
// Set the process.title immediately after processing argv if --title is set.