summaryrefslogtreecommitdiffstats
path: root/toolkit/modules/ObjectUtils.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /toolkit/modules/ObjectUtils.sys.mjs
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/modules/ObjectUtils.sys.mjs')
-rw-r--r--toolkit/modules/ObjectUtils.sys.mjs16
1 files changed, 16 insertions, 0 deletions
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)) {