Skip to content

Commit

Permalink
[Refactor] Delete unreachable code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmm committed Feb 22, 2016
1 parent bf1d4a4 commit 8af4f70
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions why.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,21 +283,7 @@ module.exports = function whyNotEqual(value, other) {
}
}
for (key in other) {
if (has(other, key)) {
if (!has(value, key)) { return 'second argument has key "' + key + '"; first does not'; }
valueKeyIsRecursive = value[key] && value[key][key] === value;
otherKeyIsRecursive = other[key] && other[key][key] === other;
if (valueKeyIsRecursive !== otherKeyIsRecursive) {
if (valueKeyIsRecursive) { return 'first argument has a circular reference at key "' + key + '"; second does not'; }
return 'second argument has a circular reference at key "' + key + '"; second does not';
}
if (!valueKeyIsRecursive && !otherKeyIsRecursive) {
keyWhy = whyNotEqual(other[key], value[key]);
if (keyWhy !== '') {
return 'value at key "' + key + '" differs: ' + keyWhy;
}
}
}
if (has(other, key) && !has(value, key)) { return 'second argument has key "' + key + '"; first does not'; }
}
return '';
}
Expand Down

0 comments on commit 8af4f70

Please sign in to comment.