bootstrap: hide experimental web globals with flag kNoBrowserGlobals · nodejs/node@e2d0195 · GitHub
Skip to content

Commit e2d0195

Browse files
legendecasjuanarbol
authored andcommitted
bootstrap: hide experimental web globals with flag kNoBrowserGlobals
Do not install experimental web globals when the environment is initialized with embedder flag `node::EnvironmentFlags::kNoBrowserGlobals`. PR-URL: #48545 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent dff6c25 commit e2d0195

3 files changed

Lines changed: 43 additions & 3 deletions

File tree

lib/internal/process/pre_execution.js

Lines changed: 4 additions & 3 deletions

src/node_options.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,12 @@ void GetEmbedderOptions(const FunctionCallbackInfo<Value>& args) {
12391239
Boolean::New(isolate, env->no_global_search_paths()))
12401240
.IsNothing()) return;
12411241

1242+
if (ret->Set(context,
1243+
FIXED_ONE_BYTE_STRING(env->isolate(), "noBrowserGlobals"),
1244+
Boolean::New(isolate, env->no_browser_globals()))
1245+
.IsNothing())
1246+
return;
1247+
12421248
args.GetReturnValue().Set(ret);
12431249
}
12441250

test/cctest/test_environment.cc

Lines changed: 33 additions & 0 deletions

0 commit comments

Comments
 (0)