NaN is never equal to NaN. Fixed in underscore.js and underscore-min.js, updated tests in test/objects.js

This commit is contained in:
Ryan W Tenney
2010-06-12 17:10:48 -04:00
parent 79f65b440a
commit 0e8ca3cb97
3 changed files with 5 additions and 3 deletions

View File

@@ -469,7 +469,7 @@
// Check dates' integer values.
if (_.isDate(a) && _.isDate(b)) return a.getTime() === b.getTime();
// Both are NaN?
if (_.isNaN(a) && _.isNaN(b)) return true;
if (_.isNaN(a) && _.isNaN(b)) return false;
// Compare regular expressions.
if (_.isRegExp(a) && _.isRegExp(b))
return a.source === b.source &&