File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -534,7 +534,9 @@ void Worker::New(const FunctionCallbackInfo<Value>& args) {
534534 }
535535
536536 if (args[1 ]->IsObject () || args[2 ]->IsArray ()) {
537- per_isolate_opts.reset (new PerIsolateOptions ());
537+ Mutex::ScopedLock lock (per_process::cli_options_mutex);
538+ per_isolate_opts.reset (
539+ new PerIsolateOptions (*per_process::cli_options->per_isolate ));
538540
539541 HandleEnvOptions (per_isolate_opts->per_env , [&env_vars](const char * name) {
540542 return env_vars->Get (name).FromMaybe (" " );
Original file line number Diff line number Diff line change 1+ // Flags: --expose-internals
2+ 'use strict' ;
3+ require ( '../common' ) ;
4+ const { Worker } = require ( 'worker_threads' ) ;
5+
6+ // Test if the flags is passed to worker threads
7+ // See https://github.com/nodejs/node/issues/52825
8+ new Worker ( `
9+ // If the --expose-internals flag does not pass to worker
10+ // require function will throw an error
11+ require('internal/options');
12+ ` , { eval : true , env : process . env } ) ;
You can’t perform that action at this time.
0 commit comments