Merge pull request #19384 from Snuffleupagus/isNumberArray-fix-BigInt-check

Handle *empty* BigInt64Array/BigUint64Array in the `isNumberArray` helper
This commit is contained in:
Jonas Jenwald
2025-01-28 10:05:01 +01:00
committed by GitHub
+1 -1
View File
@@ -280,7 +280,7 @@ function isNumberArray(arr, len) {
// BigInt64Array/BigUint64Array types (their elements aren't "number").
return (
ArrayBuffer.isView(arr) &&
(arr.length === 0 || typeof arr[0] === "number") &&
!(arr instanceof BigInt64Array || arr instanceof BigUint64Array) &&
(len === null || arr.length === len)
);
}