Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng Zhao <zcbenz@gmail.com>2022-01-05 14:01:49 +0300
committerGitHub <noreply@github.com>2022-01-05 14:01:49 +0300
commita706342368ff7c05fc2ae6b55e9eaa47815785dd (patch)
tree15cddaa27f61e0ca4f9772038fd5447d64f9ebe4 /src/node.cc
parentf34c0e0bc00bac9d1f4e375b81b8669ff0b3ce6e (diff)
src: add kNoBrowserGlobals flag for Environment
PR-URL: https://github.com/nodejs/node/pull/40532 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'src/node.cc')
-rw-r--r--src/node.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/node.cc b/src/node.cc
index 7f18a21f672..4840b18feed 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -360,7 +360,16 @@ MaybeLocal<Value> Environment::BootstrapNode() {
this, "internal/bootstrap/node", &node_params, &node_args);
if (result.IsEmpty()) {
- return scope.EscapeMaybe(result);
+ return MaybeLocal<Value>();
+ }
+
+ if (!no_browser_globals()) {
+ result = ExecuteBootstrapper(
+ this, "internal/bootstrap/browser", &node_params, &node_args);
+
+ if (result.IsEmpty()) {
+ return MaybeLocal<Value>();
+ }
}
// TODO(joyeecheung): skip these in the snapshot building for workers.
@@ -371,7 +380,7 @@ MaybeLocal<Value> Environment::BootstrapNode() {
ExecuteBootstrapper(this, thread_switch_id, &node_params, &node_args);
if (result.IsEmpty()) {
- return scope.EscapeMaybe(result);
+ return MaybeLocal<Value>();
}
auto process_state_switch_id =
@@ -382,7 +391,7 @@ MaybeLocal<Value> Environment::BootstrapNode() {
this, process_state_switch_id, &node_params, &node_args);
if (result.IsEmpty()) {
- return scope.EscapeMaybe(result);
+ return MaybeLocal<Value>();
}
Local<String> env_string = FIXED_ONE_BYTE_STRING(isolate_, "env");