| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c464ede commit 2c8276e
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -123,8 +123,6 @@ | |||
| 123 | 123 | namespace node { | |
| 124 | 124 | ||
| 125 | 125 | using native_module::NativeModuleEnv; | |
| 126 | - using options_parser::kAllowedInEnvironment; | ||
| 127 | - using options_parser::kDisallowedInEnvironment; | ||
| 128 | 126 | ||
| 129 | 127 | using v8::Boolean; | |
| 130 | 128 | using v8::EscapableHandleScope; | |
@@ -679,7 +677,7 @@ void ResetStdio() { | |||
| 679 | 677 | int ProcessGlobalArgs(std::vector<std::string>* args, | |
| 680 | 678 | std::vector<std::string>* exec_args, | |
| 681 | 679 | std::vector<std::string>* errors, | |
| 682 | - bool is_env) { | ||
| 680 | + OptionEnvvarSettings settings) { | ||
| 683 | 681 | // Parse a few arguments which are specific to Node. | |
| 684 | 682 | std::vector<std::string> v8_args; | |
| 685 | 683 | ||
@@ -689,7 +687,7 @@ int ProcessGlobalArgs(std::vector<std::string>* args, | |||
| 689 | 687 | exec_args, | |
| 690 | 688 | &v8_args, | |
| 691 | 689 | per_process::cli_options.get(), | |
| 692 | - is_env ? kAllowedInEnvironment : kDisallowedInEnvironment, | ||
| 690 | + settings, | ||
| 693 | 691 | errors); | |
| 694 | 692 | ||
| 695 | 693 | if (!errors->empty()) return 9; | |
@@ -851,12 +849,18 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv, | |||
| 851 | 849 | return 9; | |
| 852 | 850 | } | |
| 853 | 851 | ||
| 854 | - const int exit_code = ProcessGlobalArgs(&env_argv, nullptr, errors, true); | ||
| 852 | + const int exit_code = ProcessGlobalArgs(&env_argv, | ||
| 853 | + nullptr, | ||
| 854 | + errors, | ||
| 855 | + kAllowedInEnvironment); | ||
| 855 | 856 | if (exit_code != 0) return exit_code; | |
| 856 | 857 | } | |
| 857 | 858 | #endif | |
| 858 | 859 | ||
| 859 | - const int exit_code = ProcessGlobalArgs(argv, exec_argv, errors, false); | ||
| 860 | + const int exit_code = ProcessGlobalArgs(argv, | ||
| 861 | + exec_argv, | ||
| 862 | + errors, | ||
| 863 | + kDisallowedInEnvironment); | ||
| 860 | 864 | if (exit_code != 0) return exit_code; | |
| 861 | 865 | ||
| 862 | 866 | // Set the process.title immediately after processing argv if --title is set. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -225,6 +225,16 @@ NODE_EXTERN void Init(int* argc, | |||
| 225 | 225 | int* exec_argc, | |
| 226 | 226 | const char*** exec_argv); | |
| 227 | 227 | ||
| 228 | + enum OptionEnvvarSettings { | ||
| 229 | + kAllowedInEnvironment, | ||
| 230 | + kDisallowedInEnvironment | ||
| 231 | + }; | ||
| 232 | + | ||
| 233 | + NODE_EXTERN int ProcessGlobalArgs(std::vector<std::string>* args, | ||
| 234 | + std::vector<std::string>* exec_args, | ||
| 235 | + std::vector<std::string>* errors, | ||
| 236 | + OptionEnvvarSettings settings); | ||
| 237 | + | ||
| 228 | 238 | class NodeArrayBufferAllocator; | |
| 229 | 239 | ||
| 230 | 240 | // An ArrayBuffer::Allocator class with some Node.js-specific tweaks. If you do | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -247,11 +247,6 @@ HostPort SplitHostPort(const std::string& arg, | |||
| 247 | 247 | std::vector<std::string>* errors); | |
| 248 | 248 | void GetOptions(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 249 | 249 | ||
| 250 | - enum OptionEnvvarSettings { | ||
| 251 | - kAllowedInEnvironment, | ||
| 252 | - kDisallowedInEnvironment | ||
| 253 | - }; | ||
| 254 | - | ||
| 255 | 250 | enum OptionType { | |
| 256 | 251 | kNoOp, | |
| 257 | 252 | kV8Option, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | #include <string> | |
| 17 | 17 | #include <vector> | |
| 18 | 18 | ||
| 19 | - using node::options_parser::kDisallowedInEnvironment; | ||
| 19 | + using node::kDisallowedInEnvironment; | ||
| 20 | 20 | using v8::Array; | |
| 21 | 21 | using v8::ArrayBuffer; | |
| 22 | 22 | using v8::Boolean; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments