GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: expose ability to set options · nodejs/node@036a982

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node.cc
    • node.h
    • node_options.h
    • node_worker.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+10-6Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@
112112
namespace node {
113113

114114
using native_module::NativeModuleEnv;
115-
using options_parser::kAllowedInEnvironment;
116-
using options_parser::kDisallowedInEnvironment;
117115

118116
using v8::Boolean;
119117
using v8::EscapableHandleScope;
@@ -631,7 +629,7 @@ void ResetStdio() {
631629
int ProcessGlobalArgs(std::vector<std::string>* args,
632630
std::vector<std::string>* exec_args,
633631
std::vector<std::string>* errors,
634-
bool is_env) {
632+
OptionEnvvarSettings settings) {
635633
// Parse a few arguments which are specific to Node.
636634
std::vector<std::string> v8_args;
637635

@@ -641,7 +639,7 @@ int ProcessGlobalArgs(std::vector<std::string>* args,
641639
exec_args,
642640
&v8_args,
643641
per_process::cli_options.get(),
644-
is_env ? kAllowedInEnvironment : kDisallowedInEnvironment,
642+
settings,
645643
errors);
646644

647645
if (!errors->empty()) return 9;
@@ -803,12 +801,18 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
803801
return 9;
804802
}
805803

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);
807808
if (exit_code != 0) return exit_code;
808809
}
809810
#endif
810811

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);
812816
if (exit_code != 0) return exit_code;
813817

814818
// Set the process.title immediately after processing argv if --title is set.
Collapse file

‎src/node.h‎

Copy file name to clipboardExpand all lines: src/node.h
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,16 @@ NODE_EXTERN void Init(int* argc,
219219
int* exec_argc,
220220
const char*** exec_argv);
221221

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+
222232
class NodeArrayBufferAllocator;
223233

224234
// An ArrayBuffer::Allocator class with some Node.js-specific tweaks. If you do
Collapse file

‎src/node_options.h‎

Copy file name to clipboardExpand all lines: src/node_options.h
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,6 @@ HostPort SplitHostPort(const std::string& arg,
251251
std::vector<std::string>* errors);
252252
void GetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
253253

254-
enum OptionEnvvarSettings {
255-
kAllowedInEnvironment,
256-
kDisallowedInEnvironment
257-
};
258-
259254
enum OptionType {
260255
kNoOp,
261256
kV8Option,
Collapse file

‎src/node_worker.cc‎

Copy file name to clipboardExpand all lines: src/node_worker.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <string>
1717
#include <vector>
1818

19-
using node::options_parser::kDisallowedInEnvironment;
19+
using node::kDisallowedInEnvironment;
2020
using v8::Array;
2121
using v8::ArrayBuffer;
2222
using v8::Boolean;

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.