0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

fix(ext/node): make nodeGlobalThis configurable (#19163)

This commit is contained in:
Luca Casonato 2023-05-17 15:23:18 +03:00 committed by GitHub
parent 243d9c846d
commit 6a78551635
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -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
);

View file

@ -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