mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-02 20:37:21 +02:00
Merge pull request #19384 from Snuffleupagus/isNumberArray-fix-BigInt-check
Handle *empty* BigInt64Array/BigUint64Array in the `isNumberArray` helper
This commit is contained in:
commit
b0b9552216
@ -280,7 +280,7 @@ function isNumberArray(arr, len) {
|
|||||||
// BigInt64Array/BigUint64Array types (their elements aren't "number").
|
// BigInt64Array/BigUint64Array types (their elements aren't "number").
|
||||||
return (
|
return (
|
||||||
ArrayBuffer.isView(arr) &&
|
ArrayBuffer.isView(arr) &&
|
||||||
(arr.length === 0 || typeof arr[0] === "number") &&
|
!(arr instanceof BigInt64Array || arr instanceof BigUint64Array) &&
|
||||||
(len === null || arr.length === len)
|
(len === null || arr.length === len)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user