Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b7c619

Browse files
alenakhineikatargos
authored andcommitted
bootstrap: move global initialization to js
PR-URL: #43625 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]>
1 parent 61ddd50 commit 6b7c619

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

lib/internal/bootstrap/node.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ function setupGlobalProxy() {
435435
enumerable: false,
436436
configurable: true
437437
});
438+
globalThis.global = globalThis;
438439
}
439440

440441
function setupBuffer() {

src/node.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,6 @@ MaybeLocal<Value> Environment::BootstrapInternalLoaders() {
345345
MaybeLocal<Value> Environment::BootstrapNode() {
346346
EscapableHandleScope scope(isolate_);
347347

348-
Local<Object> global = context()->Global();
349-
// TODO(joyeecheung): this can be done in JS land now.
350-
global->Set(context(), FIXED_ONE_BYTE_STRING(isolate_, "global"), global)
351-
.Check();
352-
353348
// process, require, internalBinding, primordials
354349
std::vector<Local<String>> node_params = {
355350
process_string(),

0 commit comments

Comments
 (0)