From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- toolkit/modules/ObjectUtils.sys.mjs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'toolkit/modules/ObjectUtils.sys.mjs') diff --git a/toolkit/modules/ObjectUtils.sys.mjs b/toolkit/modules/ObjectUtils.sys.mjs index e0fbeead12..2c927477b7 100644 --- a/toolkit/modules/ObjectUtils.sys.mjs +++ b/toolkit/modules/ObjectUtils.sys.mjs @@ -142,6 +142,22 @@ function objEquiv(a, b) { if ((a.prototype || undefined) != (b.prototype || undefined)) { return false; } + + // Check for ArrayBuffer equality + if (instanceOf(a, "ArrayBuffer") && instanceOf(b, "ArrayBuffer")) { + if (a.byteLength !== b.byteLength) { + return false; + } + const viewA = new Uint8Array(a); + const viewB = new Uint8Array(b); + for (let i = 0; i < viewA.length; i++) { + if (viewA[i] !== viewB[i]) { + return false; + } + } + return true; + } + // Object.keys may be broken through screwy arguments passing. Converting to // an array solves the problem. if (isArguments(a)) { -- cgit v1.2.3