lodash: Update isNaN to pass IE unit test. [jddalton]

Former-commit-id: fba56af41dc05b325e809cbcfff8c5f626468cf0
This commit is contained in:
John-David Dalton
2012-04-22 21:50:14 -04:00
parent 48add6a486
commit faf9168851
3 changed files with 28 additions and 27 deletions

View File

@@ -1868,7 +1868,7 @@
if (b.isEqual && isFunction(b.isEqual)) {
return b.isEqual(a);
}
// compare `[[Class]]` names
// compare [[Class]] names
var className = toString.call(a);
if (className != toString.call(b)) {
return false;
@@ -2052,7 +2052,8 @@
*/
function isNaN(value) {
// `NaN` as a primitive is the only value that is not equal to itself
return value != +value && toString.call(value) == numberClass;
// (perform the [[Class]] check first to avoid errors with some host objects in IE)
return toString.call(value) == numberClass && value != +value
}
/**