diff --git a/src/core/core_utils.js b/src/core/core_utils.js index c507dfdcc2ca43..9d9c08fed22cb0 100644 --- a/src/core/core_utils.js +++ b/src/core/core_utils.js @@ -242,10 +242,15 @@ function isBooleanArray(arr, len) { * @returns {boolean} */ function isNumberArray(arr, len) { + // ArrayBuffer.isView... check allows us to have typed arrays but not the + // BigInt64Array/BigUint64Array types (their elements aren't "number"). return ( - Array.isArray(arr) && - (len === null || arr.length === len) && - arr.every(x => typeof x === "number") + (ArrayBuffer.isView(arr) && + (arr.length === 0 || typeof arr[0] === "number") && + (len === null || arr.length === len)) || + (Array.isArray(arr) && + (len === null || arr.length === len) && + arr.every(x => typeof x === "number")) ); } diff --git a/test/driver.js b/test/driver.js index 8b26975f92aea5..362c3d33d6ba09 100644 --- a/test/driver.js +++ b/test/driver.js @@ -610,7 +610,7 @@ class Driver { if (task.annotationStorage) { for (const annotation of Object.values(task.annotationStorage)) { - const { bitmapName } = annotation; + const { bitmapName, quadPoints } = annotation; if (bitmapName) { promise = promise.then(async doc => { const response = await fetch( @@ -643,6 +643,11 @@ class Driver { return doc; }); } + if (quadPoints) { + // Just to ensure that the quadPoints are always a Float32Array + // like IRL (in order to avoid bugs like bug 1907958). + annotation.quadPoints = new Float32Array(quadPoints); + } } }