From cda15f2a98b10330422d1c8352d163d703ee6a49 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Tue, 22 Jun 2021 07:17:35 +1000 Subject: feat: Deno namespace configurable and unfrozen (#11062) Closes #11033 --- runtime/js/06_util.js | 4 ++++ runtime/js/99_main.js | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'runtime/js') diff --git a/runtime/js/06_util.js b/runtime/js/06_util.js index 9df9ac88a..3809cc9d0 100644 --- a/runtime/js/06_util.js +++ b/runtime/js/06_util.js @@ -117,6 +117,7 @@ return { value, writable: true, + enumerable: false, configurable: true, }; } @@ -125,6 +126,8 @@ return { value, enumerable: true, + writable: false, + configurable: true, }; } @@ -132,6 +135,7 @@ return { get: getter, enumerable: true, + configurable: true, }; } diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 09a2ebb55..91a4dcefd 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -492,10 +492,9 @@ delete Object.prototype.__proto__; Object.assign(finalDenoNs, denoNsUnstable); } - // Setup `Deno` global - we're actually overriding already - // existing global `Deno` with `Deno` namespace from "./deno.ts". - util.immutableDefine(globalThis, "Deno", finalDenoNs); - Object.freeze(globalThis.Deno); + // Setup `Deno` global - we're actually overriding already existing global + // `Deno` with `Deno` namespace from "./deno.ts". + Object.defineProperty(globalThis, "Deno", util.readOnly(finalDenoNs)); Object.freeze(globalThis.Deno.core); Object.freeze(globalThis.Deno.core.sharedQueue); signals.setSignals(); -- cgit v1.2.3