diff options
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/99_main.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 19ebf7cec..2299b63f9 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -763,6 +763,12 @@ function bootstrapMainRuntime(runtimeOptions) { delete Object.prototype.__proto__; } + if (!ArrayPrototypeIncludes(unstableFeatures, unstableIds.temporal)) { + // Removes the `Temporal` API. + delete globalThis.Temporal; + delete globalThis.Date.prototype.toTemporalInstant; + } + // Setup `Deno` global - we're actually overriding already existing global // `Deno` with `Deno` namespace from "./deno.ts". ObjectDefineProperty(globalThis, "Deno", core.propReadOnly(finalDenoNs)); @@ -875,6 +881,12 @@ function bootstrapWorkerRuntime( delete Object.prototype.__proto__; } + if (!ArrayPrototypeIncludes(unstableFeatures, unstableIds.temporal)) { + // Removes the `Temporal` API. + delete globalThis.Temporal; + delete globalThis.Date.prototype.toTemporalInstant; + } + ObjectDefineProperties(finalDenoNs, { pid: core.propGetterOnly(opPid), noColor: core.propGetterOnly(() => op_bootstrap_no_color()), |