Skip to content

Commit

Permalink
Merge dc06f0c into 6753803
Browse files Browse the repository at this point in the history
  • Loading branch information
mantoni committed Dec 9, 2018
2 parents 6753803 + dc06f0c commit d727f26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 1 addition & 7 deletions lib/deep-equal.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,7 @@ function deepEqualCyclic(first, second, match) {
}

if (obj1 instanceof Error && obj2 instanceof Error) {
if (
obj1.constructor !== obj2.constructor ||
obj1.message !== obj2.message ||
obj1.stack !== obj2.stack
) {
return false;
}
return obj1 === obj2;
}

var class1 = getClass(obj1);
Expand Down
7 changes: 7 additions & 0 deletions lib/deep-equal.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,13 @@ describe("deepEqual", function() {
assert.equals(el.childNodes.length, 0);
});

it("fails unequal errors", function() {
var error1 = new Error();
var error2 = new Error();

assert.isFalse(samsam.deepEqual(error1, error2));
});

if (typeof Set !== "undefined") {
it("returns true if set with the same content", function() {
var checkDeep = samsam.deepEqual(
Expand Down

0 comments on commit d727f26

Please sign in to comment.