From 6b7c6192ff70f2adaba29d498d116e24ce63ec64 Mon Sep 17 00:00:00 2001 From: Alena Khineika Date: Fri, 8 Jul 2022 10:19:24 +0200 Subject: [PATCH] bootstrap: move global initialization to js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/43625 Reviewed-By: Antoine du Hamel Reviewed-By: Chengzhong Wu Reviewed-By: Juan José Arboleda --- lib/internal/bootstrap/node.js | 1 + src/node.cc | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 6d8baf469ad..75c81c04575 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -435,6 +435,7 @@ function setupGlobalProxy() { enumerable: false, configurable: true }); + globalThis.global = globalThis; } function setupBuffer() { diff --git a/src/node.cc b/src/node.cc index 841d912caeb..155e9a26c0b 100644 --- a/src/node.cc +++ b/src/node.cc @@ -345,11 +345,6 @@ MaybeLocal Environment::BootstrapInternalLoaders() { MaybeLocal Environment::BootstrapNode() { EscapableHandleScope scope(isolate_); - Local global = context()->Global(); - // TODO(joyeecheung): this can be done in JS land now. - global->Set(context(), FIXED_ONE_BYTE_STRING(isolate_, "global"), global) - .Check(); - // process, require, internalBinding, primordials std::vector> node_params = { process_string(),