aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJordan Harband <ljharb@gmail.com>2019-08-06 13:41:13 -0700
committerGus Caplan <me@gus.host>2019-08-09 10:29:58 -0500
commit6c3af76fef66c4319af45c08cc49a91ec4495214 (patch)
tree673063d995312ee3ab5c10bd8c2547b8c482c6a7 /lib
parente079f6c93e16008d5175e354160023124c5012fc (diff)
downloadandroid-node-v8-6c3af76fef66c4319af45c08cc49a91ec4495214.tar.gz
android-node-v8-6c3af76fef66c4319af45c08cc49a91ec4495214.tar.bz2
android-node-v8-6c3af76fef66c4319af45c08cc49a91ec4495214.zip
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/util/comparisons.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js
index db69a5a54d..777ae07aed 100644
--- a/lib/internal/util/comparisons.js
+++ b/lib/internal/util/comparisons.js
@@ -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);