Skip to content

Commit 8426077

Browse files
ljharbtargos
authored andcommitted
util: assert: fix deepEqual comparing fake-boxed to real boxed primitive
PR-URL: #29029 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent f9ed5f3 commit 8426077

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/util/comparisons.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ function innerDeepEqual(val1, val2, strict, memos) {
221221
if (!areEqualArrayBuffers(val1, val2)) {
222222
return false;
223223
}
224-
} else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {
224+
}
225+
if ((isBoxedPrimitive(val1) || isBoxedPrimitive(val2)) &&
226+
!isEqualBoxedPrimitive(val1, val2)) {
225227
return false;
226228
}
227229
return keyCheck(val1, val2, strict, memos, kNoIterator);

0 commit comments

Comments
 (0)