From 1f3d88759b242fe35398fe0b19f72fc5550eea58 Mon Sep 17 00:00:00 2001 From: Dimitar <19364673+Dimitar5555@users.noreply.github.com> Date: Sat, 3 Feb 2024 16:39:50 +0000 Subject: [PATCH] Fixed a bug which didn't allow proper comparison of objects Ref: #9502 and #9788 --- modules/util/array.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/util/array.js b/modules/util/array.js index b653271da5..fdd5fa3d91 100644 --- a/modules/util/array.js +++ b/modules/util/array.js @@ -7,7 +7,8 @@ export function utilArrayIdentical(a, b) { var i = a.length; if (i !== b.length) return false; while (i--) { - if (a[i] !== b[i]) return false; + // When a and b contain objects, the !== operator will compare their references which may be diffrent even if the object is the same, related #9502 + if (JSON.stringify(a[i]) !== JSON.stringify(b[i])) return false; } return true; }