Repository: denoland/deno_core
Pull request #707 (2024-04-21 17:29:31)

feat: update v8 flags
related: https://github.com/denoland/deno/issues/17944#issuecomment-2068131513, https://github.com/denoland/deno/issues/23450

Removed flags enabled by default and added flags for ~~Explicit Resource Management~~ and Float16Array.

petamoriken: It failed to install `libc6-dbg` by apt-get in CI

```
The following NEW packages will be installed:
  libc6-dbg valgrind
0 upgraded, 2 newly installed, 0 to remove and 20 not upgraded.
Need to get 27.9 MB of archives.
After this operation, 98.0 MB of additional disk space will be used.
Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist [142 B]
Ign:2 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc6-dbg amd64 2.35-0ubuntu3.6
Get:3 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64 valgrind amd64 1:3.18.1-1ubuntu2 [14.1 MB]
Ign:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc6-dbg amd64 2.35-0ubuntu3.6
Ign:2 http://security.ubuntu.com/ubuntu jammy-updates/main amd64 libc6-dbg amd64 2.35-0ubuntu3.6
Err:2 mirror+file:/etc/apt/apt-mirrors.txt jammy-updates/main amd64 libc6-dbg amd64 2.35-0ubuntu3.6
  404  Not Found [IP: 52.147.219.192 80]
E: Failed to fetch mirror+file:/etc/apt/apt-mirrors.txt/pool/main/g/glibc/libc6-dbg_2.35-0ubuntu3.6_amd64.deb  404  Not Found [IP: 52.147.219.192 80]
```

Patch:
diff --git a/core/runtime/setup.rs b/core/runtime/setup.rs
index 17ac839..de3a68a 100644
--- a/core/runtime/setup.rs
+++ b/core/runtime/setup.rs
@@ -23,13 +23,10 @@ fn v8_init(
 
   let base_flags = concat!(
     " --wasm-test-streaming",
-    " --harmony-import-assertions",
-    " --harmony-import-attributes",
     " --no-validate-asm",
     " --turbo_fast_api_calls",
-    " --harmony-array-from_async",
-    " --harmony-iterator-helpers",
     " --harmony-temporal",
+    " --js-float16array",
   );
   let snapshot_flags = "--predictable --random-seed=42";
   let expose_natives_flags = "--expose_gc --allow_natives_syntax";


Test patch:
diff --git a/.github/workflows/ci-test/action.yml b/.github/workflows/ci-test/action.yml
index a8d17c5..e446585 100644
--- a/.github/workflows/ci-test/action.yml
+++ b/.github/workflows/ci-test/action.yml
@@ -5,7 +5,7 @@ runs:
     - name: Cargo test
       shell: bash
       run: |-
-        cargo test --workspace --release --all-features --bins --tests --examples --exclude deno_ops_compile_test_runner
+        cargo test --workspace --release --all-features --tests --examples --exclude deno_ops_compile_test_runner
         cargo test --doc
 
     - name: Run examples
diff --git a/testing/unit/tc39_test.ts b/testing/unit/tc39_test.ts
index 841c81d..7d59ca2 100644
--- a/testing/unit/tc39_test.ts
+++ b/testing/unit/tc39_test.ts
@@ -39,8 +39,28 @@ test(function testIteratorHelpers() {
   }
 });
 
-// Verify that the "Temporal" proposal is enabled
-test(function testTemporalEnabled() {
+// Verify that "Set methods" proposal is enabled (https://github.com/tc39/proposal-set-methods)
+test(function testSetMethods() {
+  // @ts-expect-error: Not available in TypeScript yet
+  const a: Set<number> = new Set([1, 2, 3]).intersection(new Set([3, 4, 5]));
+  if (a.size !== 1 && !a.has(3)) {
+    fail("failed");
+  }
+});
+
+// Verify that the "Temporal" proposal is enabled (https://github.com/tc39/proposal-temporal)
+test(function testTemporal() {
   // @ts-expect-error: Not available in TypeScript yet
   assert(typeof Temporal !== "undefined");
 });
+
+// Verify that the "Float16Array" proposal is enabled (https://github.com/tc39/proposal-float16array)
+test(function testFloat16Array() {
+  // @ts-expect-error: Not available in TypeScript yet
+  const a = new Float16Array([Math.PI]);
+  assert(a[0] === 3.140625);
+  // @ts-expect-error: Not available in TypeScript yet
+  assert(typeof DataView.prototype.getFloat16 !== "undefined");
+  // @ts-expect-error: Not available in TypeScript yet
+  assert(typeof DataView.prototype.setFloat16 !== "undefined");
+});