Skip to content

Commit

Permalink
bootstrap: move global initialization to js
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
alenakhineika authored Jul 8, 2022
1 parent 6317b84 commit 680dd7c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 1 addition & 0 deletions lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ function setupGlobalProxy() {
enumerable: false,
configurable: true
});
globalThis.global = globalThis;
}

function setupBuffer() {
Expand Down
5 changes: 0 additions & 5 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,6 @@ MaybeLocal<Value> Environment::BootstrapInternalLoaders() {
MaybeLocal<Value> Environment::BootstrapNode() {
EscapableHandleScope scope(isolate_);

Local<Object> 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<Local<String>> node_params = {
process_string(),
Expand Down

0 comments on commit 680dd7c

Please sign in to comment.