Repository: denoland/deno_core (rust)

Issue:
Enable Temporal API by default
Working on https://github.com/denoland/deno/pull/22134 I had to pass a V8 flag on startup to enable Temporal API (I then conditionally remove it from global scope on startup if appropriate unstable is not provided). The problem is that Temporal won't be available in the snapshot and will probably cause a slowdown on startup.

We should enable Temporal by default in `deno_core` by passing `--harmony-temporal` flag in:
https://github.com/denoland/deno_core/blob/b326a2188e7b0eb71830377459b46fb5d0441fd8/core/runtime/setup.rs#L24-L32

Then a simple test that checks for presence of `Temporal` global will be needed:
```rust
runtime.execute_script("test.js", r#"if (typeof Temporal === "undefined") throw new Error()"#)
```

Pull request description:
fix: Enable the Temporal API proposal by default
Fixes #641 

Patch:
diff --git a/core/runtime/setup.rs b/core/runtime/setup.rs
index 94f2411..dbe9b0c 100644
--- a/core/runtime/setup.rs
+++ b/core/runtime/setup.rs
@@ -29,6 +29,7 @@ fn v8_init(
     " --turbo_fast_api_calls",
     " --harmony-array-from_async",
     " --harmony-iterator-helpers",
+    " --harmony-temporal",
   );
   let predictable_flags = "--predictable --random-seed=42";
   let expose_natives_flags = "--expose_gc --allow_natives_syntax";


Test patch:
diff --git a/testing/unit/tc39_test.ts b/testing/unit/tc39_test.ts
index d4a8785..841c81d 100644
--- a/testing/unit/tc39_test.ts
+++ b/testing/unit/tc39_test.ts
@@ -1,5 +1,5 @@
 // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import { fail, test } from "checkin:testing";
+import { assert, fail, test } from "checkin:testing";
 
 // Verify that "array by copy" proposal is enabled (https://github.com/tc39/proposal-change-array-by-copy)
 test(function testArrayByCopy() {
@@ -38,3 +38,9 @@ test(function testIteratorHelpers() {
     fail("failed");
   }
 });
+
+// Verify that the "Temporal" proposal is enabled
+test(function testTemporalEnabled() {
+  // @ts-expect-error: Not available in TypeScript yet
+  assert(typeof Temporal !== "undefined");
+});