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 <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]>
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

+3-1
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)