Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert: remove unused code #27676

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
assert: remove unused code
Those two operators are not used.
  • Loading branch information
BridgeAR committed May 13, 2019
commit 3981149de67ee244944b7e652824d2b2bcd44e54
5 changes: 2 additions & 3 deletions lib/internal/assert/assertion_error.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,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)}...`;
Expand All @@ -387,7 +386,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 {
Expand Down