From 842607789865ad597b575e6b030dab5b05193662 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 6 Aug 2019 13:41:13 -0700 Subject: [PATCH] util: assert: fix deepEqual comparing fake-boxed to real boxed primitive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/29029 Reviewed-By: James M Snell Reviewed-By: Gus Caplan Reviewed-By: Michaƫl Zasso Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott --- lib/internal/util/comparisons.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index db69a5a54dad59..777ae07aed85a4 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);