summaryrefslogtreecommitdiff
path: root/runtime/js/99_main.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-03-07 23:06:28 +0000
committerGitHub <noreply@github.com>2024-03-08 00:06:28 +0100
commit2d5b19277b483de64087822934d42fc3e09c1c24 (patch)
treee5ae574a4020232afb654ec723440ec7fd1bee64 /runtime/js/99_main.js
parent914b7495a854981a3671e24f527d792f2ad1b324 (diff)
chore: upgrade deno_core (#22782)
Diffstat (limited to 'runtime/js/99_main.js')
-rw-r--r--runtime/js/99_main.js12
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()),