mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
fix(ext/node): make nodeGlobalThis configurable (#19163)
This commit is contained in:
parent
243d9c846d
commit
6a78551635
2 changed files with 3 additions and 1 deletions
|
@ -490,6 +490,8 @@ pub fn initialize_runtime(
|
||||||
usesLocalNodeModulesDir,
|
usesLocalNodeModulesDir,
|
||||||
argv0
|
argv0
|
||||||
);
|
);
|
||||||
|
// Make the nodeGlobalThisName unconfigurable here.
|
||||||
|
Object.defineProperty(globalThis, nodeGlobalThisName, {{ configurable: false }});
|
||||||
}})('{}', {}, {});"#,
|
}})('{}', {}, {});"#,
|
||||||
NODE_GLOBAL_THIS_NAME, uses_local_node_modules_dir, argv0
|
NODE_GLOBAL_THIS_NAME, uses_local_node_modules_dir, argv0
|
||||||
);
|
);
|
||||||
|
|
|
@ -40,7 +40,7 @@ function initialize(
|
||||||
// get node's globalThis
|
// get node's globalThis
|
||||||
ObjectDefineProperty(globalThis, nodeGlobalThisName, {
|
ObjectDefineProperty(globalThis, nodeGlobalThisName, {
|
||||||
enumerable: false,
|
enumerable: false,
|
||||||
writable: true,
|
configurable: true,
|
||||||
value: nodeGlobalThis,
|
value: nodeGlobalThis,
|
||||||
});
|
});
|
||||||
// FIXME(bartlomieju): not nice to depend on `Deno` namespace here
|
// FIXME(bartlomieju): not nice to depend on `Deno` namespace here
|
||||||
|
|
Loading…
Add table
Reference in a new issue