From da4f3d234c92ad430dcdc11cf7390d4c8ddbd93f Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Thu, 13 Jun 2024 11:22:43 -0400 Subject: [PATCH] fix: correct comparison --- lib/internal/util/comparisons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index b5d2d071479dec7..9bb740d43befdbc 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -502,7 +502,7 @@ function setEquiv(a, b, strict, memo) { for (const val of b) { // Primitive values have already been handled above. if (typeof val === 'object' && val !== null) { - if (!setHasEqualElement(set, val, strict, memo)) + if (!a.has(val) && !setHasEqualElement(set, val, strict, memo)) return false; } else if (!strict && !a.has(val) &&