bootstrap: move global initialization to js

PR-URL: https://github.com/nodejs/node/pull/43625
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
Alena Khineika authored and Michaël Zasso committed 2022-07-31 09:45:11 +02:00
1 parent 61ddd50c38
commit 6b7c6192ff
2 files changed
+1 -5

No files matched your search

+1
View File
@@ -435,6 +435,7 @@ function setupGlobalProxy() {
enumerable: false,
configurable: true
});
globalThis.global = globalThis;
}
function setupBuffer() {
-5
View File
@@ -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(),