| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 138a905 commit a81eae6
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -112,8 +112,6 @@ | |||
| 112 | 112 | namespace node { | |
| 113 | 113 | ||
| 114 | 114 | using native_module::NativeModuleEnv; | |
| 115 | - using options_parser::kAllowedInEnvironment; | ||
| 116 | - using options_parser::kDisallowedInEnvironment; | ||
| 117 | 115 | ||
| 118 | 116 | using v8::Boolean; | |
| 119 | 117 | using v8::EscapableHandleScope; | |
@@ -631,7 +629,7 @@ void ResetStdio() { | |||
| 631 | 629 | int ProcessGlobalArgs(std::vector<std::string>* args, | |
| 632 | 630 | std::vector<std::string>* exec_args, | |
| 633 | 631 | std::vector<std::string>* errors, | |
| 634 | - bool is_env) { | ||
| 632 | + OptionEnvvarSettings settings) { | ||
| 635 | 633 | // Parse a few arguments which are specific to Node. | |
| 636 | 634 | std::vector<std::string> v8_args; | |
| 637 | 635 | ||
@@ -641,7 +639,7 @@ int ProcessGlobalArgs(std::vector<std::string>* args, | |||
| 641 | 639 | exec_args, | |
| 642 | 640 | &v8_args, | |
| 643 | 641 | per_process::cli_options.get(), | |
| 644 | - is_env ? kAllowedInEnvironment : kDisallowedInEnvironment, | ||
| 642 | + settings, | ||
| 645 | 643 | errors); | |
| 646 | 644 | ||
| 647 | 645 | if (!errors->empty()) return 9; | |
@@ -803,12 +801,18 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv, | |||
| 803 | 801 | return 9; | |
| 804 | 802 | } | |
| 805 | 803 | ||
| 806 | - const int exit_code = ProcessGlobalArgs(&env_argv, nullptr, errors, true); | ||
| 804 | + const int exit_code = ProcessGlobalArgs(&env_argv, | ||
| 805 | + nullptr, | ||
| 806 | + errors, | ||
| 807 | + kAllowedInEnvironment); | ||
| 807 | 808 | if (exit_code != 0) return exit_code; | |
| 808 | 809 | } | |
| 809 | 810 | #endif | |
| 810 | 811 | ||
| 811 | - const int exit_code = ProcessGlobalArgs(argv, exec_argv, errors, false); | ||
| 812 | + const int exit_code = ProcessGlobalArgs(argv, | ||
| 813 | + exec_argv, | ||
| 814 | + errors, | ||
| 815 | + kDisallowedInEnvironment); | ||
| 812 | 816 | if (exit_code != 0) return exit_code; | |
| 813 | 817 | ||
| 814 | 818 | // Set the process.title immediately after processing argv if --title is set. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -219,6 +219,16 @@ NODE_EXTERN void Init(int* argc, | |||
| 219 | 219 | int* exec_argc, | |
| 220 | 220 | const char*** exec_argv); | |
| 221 | 221 | ||
| 222 | + enum OptionEnvvarSettings { | ||
| 223 | + kAllowedInEnvironment, | ||
| 224 | + kDisallowedInEnvironment | ||
| 225 | + }; | ||
| 226 | + | ||
| 227 | + NODE_EXTERN int ProcessGlobalArgs(std::vector<std::string>* args, | ||
| 228 | + std::vector<std::string>* exec_args, | ||
| 229 | + std::vector<std::string>* errors, | ||
| 230 | + OptionEnvvarSettings settings); | ||
| 231 | + | ||
| 222 | 232 | class NodeArrayBufferAllocator; | |
| 223 | 233 | ||
| 224 | 234 | // An ArrayBuffer::Allocator class with some Node.js-specific tweaks. If you do | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -253,11 +253,6 @@ HostPort SplitHostPort(const std::string& arg, | |||
| 253 | 253 | std::vector<std::string>* errors); | |
| 254 | 254 | void GetOptions(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 255 | 255 | ||
| 256 | - enum OptionEnvvarSettings { | ||
| 257 | - kAllowedInEnvironment, | ||
| 258 | - kDisallowedInEnvironment | ||
| 259 | - }; | ||
| 260 | - | ||
| 261 | 256 | enum OptionType { | |
| 262 | 257 | kNoOp, | |
| 263 | 258 | 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