Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update eql.js to do strict equality on non objects.
  • Loading branch information
Thaddaeus Clay committed Sep 14, 2011
1 parent ad6ef6b commit 0988640
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/eql.js
Expand Up @@ -26,7 +26,7 @@ function _deepEqual(actual, expected) {
// 7.3. Other pairs that do not both pass typeof value == "object",
// equivalence is determined by ==.
} else if (typeof actual != 'object' && typeof expected != 'object') {
return actual == expected;
return actual === expected;

// 7.4. For all other Object pairs, including Array objects, equivalence is
// determined by having the same number of owned properties (as verified
Expand Down
2 changes: 1 addition & 1 deletion test/should.test.js
Expand Up @@ -158,7 +158,7 @@ module.exports = {
'test'.should.eql('test');
({ foo: 'bar' }).should.eql({ foo: 'bar' });
(1).should.eql(1);
'4'.should.eql(4);
'4'.should.not.eql(4);

err(function(){
(4).should.eql(3);
Expand Down

0 comments on commit 0988640

Please sign in to comment.