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
commit b0b9552216
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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)
);
}