Skip to content

Commit

Permalink
util: assert: fix deepEqual comparing fake-boxed to real boxed primitive
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
ljharb authored and targos committed Aug 19, 2019
1 parent f9ed5f3 commit 8426077
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/util/comparisons.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ function innerDeepEqual(val1, val2, strict, memos) {
if (!areEqualArrayBuffers(val1, val2)) {
return false;
}
} else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {
}
if ((isBoxedPrimitive(val1) || isBoxedPrimitive(val2)) &&
!isEqualBoxedPrimitive(val1, val2)) {
return false;
}
return keyCheck(val1, val2, strict, memos, kNoIterator);
Expand Down

0 comments on commit 8426077

Please sign in to comment.