From 883abfa1bfeb4eded1ebdb8cc7364c254dcaad2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 9 Dec 2024 19:04:47 +0000 Subject: [PATCH] fix(ext/node): handle Float16Array in node:v8 module (#27285) Closes https://github.com/denoland/deno/issues/26580 --- ext/node/polyfills/v8.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/node/polyfills/v8.ts b/ext/node/polyfills/v8.ts index 9df199865e..e24a79ab5a 100644 --- a/ext/node/polyfills/v8.ts +++ b/ext/node/polyfills/v8.ts @@ -227,6 +227,7 @@ function arrayBufferViewTypeToIndex(abView: ArrayBufferView) { // Index 10 is FastBuffer. if (type === "[object BigInt64Array]") return 11; if (type === "[object BigUint64Array]") return 12; + if (type === "[object Float16Array]") return 13; return -1; } export class DefaultSerializer extends Serializer { @@ -276,6 +277,7 @@ function arrayBufferViewIndexToType(index: number): any { if (index === 10) return Buffer; if (index === 11) return BigInt64Array; if (index === 12) return BigUint64Array; + if (index === 13) return Float16Array; return undefined; }