Skip to content

Commit 0783663

Browse files
alenakhineikatargos
authored andcommitted
bootstrap: move global initialization to js
PR-URL: #43625 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
1 parent 9d918d9 commit 0783663

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

lib/internal/bootstrap/node.js

+1
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ function setupGlobalProxy() {
402402
enumerable: false,
403403
configurable: true
404404
});
405+
globalThis.global = globalThis;
405406
}
406407

407408
function setupBuffer() {

src/node.cc

-5
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,6 @@ MaybeLocal<Value> Environment::BootstrapInternalLoaders() {
342342
MaybeLocal<Value> Environment::BootstrapNode() {
343343
EscapableHandleScope scope(isolate_);
344344

345-
Local<Object> global = context()->Global();
346-
// TODO(joyeecheung): this can be done in JS land now.
347-
global->Set(context(), FIXED_ONE_BYTE_STRING(isolate_, "global"), global)
348-
.Check();
349-
350345
// process, require, internalBinding, primordials
351346
std::vector<Local<String>> node_params = {
352347
process_string(),

0 commit comments

Comments
 (0)