assert: remove unused code

Those two operators are not used.

PR-URL: https://github.com/nodejs/node/pull/27676
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
Ruben Bridgewater 2019-05-13 15:14:03 +02:00
parent 5b26609e5a
commit 35fc1b4e96
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762
1 changed files with 2 additions and 3 deletions

View File

@ -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 {