From 7cc21d8afa595a84ff988bdc86908a49ddfed9bd Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 13 May 2019 15:14:03 +0200 Subject: [PATCH] assert: remove unused code Those two operators are not used. PR-URL: https://github.com/nodejs/node/pull/27676 Reviewed-By: Rich Trott Reviewed-By: Yongsheng Zhang Reviewed-By: Trivikram Kamat --- lib/internal/assert/assertion_error.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/assert/assertion_error.js b/lib/internal/assert/assertion_error.js index b0226e879ad9ba..7b62fca0352f5d 100644 --- a/lib/internal/assert/assertion_error.js +++ b/lib/internal/assert/assertion_error.js @@ -375,8 +375,7 @@ class AssertionError extends Error { let res = inspectValue(actual); let other = inspectValue(expected); const knownOperators = kReadableOperator[operator]; - if ((operator === 'notDeepEqual' || operator === 'notEqual') && - res === other) { + if (operator === 'notDeepEqual' && res === other) { res = `${knownOperators}\n\n${res}`; if (res.length > 1024) { res = `${res.slice(0, 1021)}...`; @@ -389,7 +388,7 @@ class AssertionError extends Error { if (other.length > 512) { other = `${other.slice(0, 509)}...`; } - if (operator === 'deepEqual' || operator === 'equal') { + if (operator === 'deepEqual') { const eq = operator === 'deepEqual' ? 'deep-equal' : 'equal'; res = `${knownOperators}\n\n${res}\n\nshould loosely ${eq}\n\n`; } else {