@@ -163,7 +163,6 @@ static bool trace_sync_io = false;
163
163
static bool track_heap_objects = false ;
164
164
static const char * eval_string = nullptr ;
165
165
static std::vector<std::string> preload_modules;
166
- static bool expose_internals = false ;
167
166
static const int v8_default_thread_pool_size = 4 ;
168
167
static int v8_thread_pool_size = v8_default_thread_pool_size;
169
168
static bool prof_process = false ;
@@ -216,6 +215,12 @@ bool config_preserve_symlinks = false;
216
215
// Set in node.cc by ParseArgs when --redirect-warnings= is used.
217
216
std::string config_warning_file; // NOLINT(runtime/string)
218
217
218
+ // Set in node.cc by ParseArgs when --expose-internals or --expose_internals is
219
+ // used.
220
+ // Used in node_config.cc to set a constant on process.binding('config')
221
+ // that is used by lib/internal/bootstrap_node.js
222
+ bool config_expose_internals = false ;
223
+
219
224
bool v8_initialized = false ;
220
225
221
226
// process-relative uptime base, initialized at start-up
@@ -3334,13 +3339,6 @@ void SetupProcessObject(Environment* env,
3334
3339
READONLY_PROPERTY (process, " _debugWaitConnect" , True (env->isolate ()));
3335
3340
}
3336
3341
3337
- // --expose_internals, --expose-internals
3338
- // Note that this is not exposed as a process property, it is deleted when
3339
- // node's javascript bootstrap code runs.
3340
- if (expose_internals) {
3341
- READONLY_PROPERTY (process, " _exposeInternals" , True (env->isolate ()));
3342
- }
3343
-
3344
3342
// --security-revert flags
3345
3343
#define V (code, _, __ ) \
3346
3344
do { \
@@ -3794,7 +3792,7 @@ static void ParseArgs(int* argc,
3794
3792
#endif
3795
3793
} else if (strcmp (arg, " --expose-internals" ) == 0 ||
3796
3794
strcmp (arg, " --expose_internals" ) == 0 ) {
3797
- expose_internals = true ;
3795
+ config_expose_internals = true ;
3798
3796
} else if (strcmp (arg, " --" ) == 0 ) {
3799
3797
index += 1 ;
3800
3798
break ;
0 commit comments