From d256c94cc5c94753d672ed7ffa1a39577da24c22 Mon Sep 17 00:00:00 2001 From: sliftist <52947011+sliftist@users.noreply.github.com> Date: Fri, 8 Mar 2024 20:27:32 -0500 Subject: [PATCH 1/2] Remove common caught exception --- src/_util/is.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_util/is.mjs b/src/_util/is.mjs index db6ff424..77afb758 100644 --- a/src/_util/is.mjs +++ b/src/_util/is.mjs @@ -61,6 +61,8 @@ export function isNativeBigIntTypedArray(value) { */ function isArrayBuffer(value) { try { + // ArrayBuffers are never arrays + if (Array.isArray(value)) return false; ArrayBufferPrototypeGetByteLength(/** @type {any} */ (value)); return true; } catch (e) { From d79920f7768398c689c7405618eb596f2ae2e7d6 Mon Sep 17 00:00:00 2001 From: sliftist <52947011+sliftist@users.noreply.github.com> Date: Sat, 9 Mar 2024 06:44:06 -0500 Subject: [PATCH 2/2] Update src/_util/is.mjs Co-authored-by: Kenta Moriuchi --- src/_util/is.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_util/is.mjs b/src/_util/is.mjs index 77afb758..9699cff8 100644 --- a/src/_util/is.mjs +++ b/src/_util/is.mjs @@ -62,7 +62,9 @@ export function isNativeBigIntTypedArray(value) { function isArrayBuffer(value) { try { // ArrayBuffers are never arrays - if (Array.isArray(value)) return false; + if (ArrayIsArray(value)) { + return false; + } ArrayBufferPrototypeGetByteLength(/** @type {any} */ (value)); return true; } catch (e) {