summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/node/lib.rs2
-rw-r--r--ext/node/polyfills/02_init.js2
2 files changed, 3 insertions, 1 deletions
diff --git a/ext/node/lib.rs b/ext/node/lib.rs
index 9f6e68461..4c81351a8 100644
--- a/ext/node/lib.rs
+++ b/ext/node/lib.rs
@@ -490,6 +490,8 @@ pub fn initialize_runtime(
usesLocalNodeModulesDir,
argv0
);
+ // Make the nodeGlobalThisName unconfigurable here.
+ Object.defineProperty(globalThis, nodeGlobalThisName, {{ configurable: false }});
}})('{}', {}, {});"#,
NODE_GLOBAL_THIS_NAME, uses_local_node_modules_dir, argv0
);
diff --git a/ext/node/polyfills/02_init.js b/ext/node/polyfills/02_init.js
index 3aef00060..dc8955d83 100644
--- a/ext/node/polyfills/02_init.js
+++ b/ext/node/polyfills/02_init.js
@@ -40,7 +40,7 @@ function initialize(
// get node's globalThis
ObjectDefineProperty(globalThis, nodeGlobalThisName, {
enumerable: false,
- writable: true,
+ configurable: true,
value: nodeGlobalThis,
});
// FIXME(bartlomieju): not nice to depend on `Deno` namespace here