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 and targos committed Jul 20, 2022
1 parent d75cf95 commit 34f5041
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 @@ -435,6 +435,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 @@ -345,11 +345,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 34f5041

Please sign in to comment.