From 2d5b19277b483de64087822934d42fc3e09c1c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 7 Mar 2024 23:06:28 +0000 Subject: chore: upgrade deno_core (#22782) --- runtime/js/99_main.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'runtime/js') 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()), -- cgit v1.2.3