Merge pull request #697 from twpayne/fix-nan-test

Fix NaN test
This commit is contained in:
Tom Payne
2013-05-08 05:59:16 -07:00

View File

@@ -1058,7 +1058,8 @@
// 7.3. Other pairs that do not both pass typeof value == "object",
// equivalence is determined by ==.
} else if (typeof actual != 'object' && typeof expected != 'object') {
if (isNaN(actual) && isNaN(expected)) {
if (typeof actual == 'number' && isNaN(actual) &&
typeof expected == 'number' && isNaN(expected)) {
return true;
} else {
return actual == expected;