From f75a1265a8eef5c2058be1fde6eefa4ca0b5990f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Mon, 5 May 2025 01:00:56 +0200 Subject: [PATCH] src: enable `Float16Array` on global object This feature is enabled in stable Chrome 136 but not in V8 by default. PR-URL: https://github.com/nodejs/node/pull/58154 Reviewed-By: Matteo Collina Reviewed-By: Colin Ihrig Reviewed-By: Antoine du Hamel Reviewed-By: Rafael Gonzaga Reviewed-By: Yagiz Nizipli --- src/node.cc | 1 + test/common/globals.js | 1 + test/wpt/status/encoding.json | 6 ------ 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/node.cc b/src/node.cc index d4a1cf65136..ddde8d4b2a2 100644 --- a/src/node.cc +++ b/src/node.cc @@ -848,6 +848,7 @@ static ExitCode InitializeNodeWithArgsInternal( // These features are completed and enabled by default in Chrome, but not // in V8. V8::SetFlagsFromString("--js-explicit-resource-management"); + V8::SetFlagsFromString("--js-float16array"); #if defined(NODE_V8_OPTIONS) // Should come before the call to V8::SetFlagsFromCommandLine() diff --git a/test/common/globals.js b/test/common/globals.js index de50724b7c6..1641c4df36b 100644 --- a/test/common/globals.js +++ b/test/common/globals.js @@ -33,6 +33,7 @@ const intrinsics = new Set([ 'Int8Array', 'Uint16Array', 'Int16Array', + 'Float16Array', 'Uint32Array', 'Int32Array', 'Float32Array', diff --git a/test/wpt/status/encoding.json b/test/wpt/status/encoding.json index f9378d7195a..c258031e485 100644 --- a/test/wpt/status/encoding.json +++ b/test/wpt/status/encoding.json @@ -70,12 +70,6 @@ "requires": ["full-icu"] }, "encodeInto.any.js": { - "fail": { - "expected": [ - "Invalid encodeInto() destination: Float16Array, backed by: ArrayBuffer", - "Invalid encodeInto() destination: Float16Array, backed by: SharedArrayBuffer" - ] - }, "requires": ["small-icu"] }, "textdecoder-copy.any.js": {