util: assert: fix deepEqual comparing fake-boxed to real boxed primitive

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Jordan Harband 2019-08-06 13:41:13 -07:00 committed by Gus Caplan
parent e079f6c93e
commit 6c3af76fef
No known key found for this signature in database
GPG Key ID: F00BD11880E82F0E

View File

@ -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);