summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/06_util.js14
-rw-r--r--runtime/js/99_main.js3
2 files changed, 1 insertions, 16 deletions
diff --git a/runtime/js/06_util.js b/runtime/js/06_util.js
index b6a3c3438..97c0adea4 100644
--- a/runtime/js/06_util.js
+++ b/runtime/js/06_util.js
@@ -3,7 +3,6 @@
((window) => {
const {
- ObjectDefineProperty,
StringPrototypeReplace,
TypeError,
Promise,
@@ -55,18 +54,6 @@
return promise;
}
- function immutableDefine(
- o,
- p,
- value,
- ) {
- ObjectDefineProperty(o, p, {
- value,
- configurable: false,
- writable: false,
- });
- }
-
// Keep in sync with `fromFileUrl()` in `std/path/win32.ts`.
function pathFromURLWin32(url) {
let p = StringPrototypeReplace(
@@ -164,7 +151,6 @@
createResolvable,
assert,
AssertionError,
- immutableDefine,
pathFromURL,
writable,
nonEnumerable,
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index fc3eeecca..c9dd611da 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -695,8 +695,7 @@ delete Object.prototype.__proto__;
});
// Setup `Deno` global - we're actually overriding already
// existing global `Deno` with `Deno` namespace from "./deno.ts".
- util.immutableDefine(globalThis, "Deno", finalDenoNs);
- ObjectFreeze(globalThis.Deno);
+ ObjectDefineProperty(globalThis, "Deno", util.readOnly(finalDenoNs));
ObjectFreeze(globalThis.Deno.core);
signals.setSignals();
} else {