diff --git a/index.js b/index.js index 01bd58e..f52d861 100644 --- a/index.js +++ b/index.js @@ -86,6 +86,7 @@ Traverse.prototype.deepEqual = function (obj) { // both regexps on account of the __proto__ check if (x.toString() != y.toString()) notEqual(); } + else if (x !== y) notEqual(); } else if (typeof x === 'object') { if (x === null || y === null) { diff --git a/test/equal.js b/test/equal.js index 4290c47..f8a715f 100644 --- a/test/equal.js +++ b/test/equal.js @@ -64,7 +64,7 @@ exports.deepInstances = function () { )); var f = function (x) { return x * 2 }; - assert.ok(!traverse.deepEqual( + assert.ok(traverse.deepEqual( [ f ], [ f ], 'these functions are actually equal' ));