Extend equalArray to consider NaNs to be equal

This commit is contained in:
Tom Payne
2013-03-19 07:39:52 +01:00
parent 6ab5cfae8c
commit 5169161d93

View File

@@ -522,7 +522,8 @@
if (equal) {
var j = 0;
for (j = 0; j < other.length; ++j) {
if (this.obj[j] !== other[j]) {
if (this.obj[j] !== other[j] &&
!(isNaN(this.obj[j]) && isNaN(other[j]))) {
equal = false;
break;
}