Ox.isEqual(NaN, NaN) should return true
This commit is contained in:
parent
bc83d22850
commit
4dc11cd256
1 changed files with 3 additions and 2 deletions
|
@ -104,7 +104,7 @@ Ox.isEqual <function> Returns true if two values are equal
|
|||
> Ox.isEqual(Infinity, -Infinity)
|
||||
false
|
||||
> Ox.isEqual(NaN, NaN)
|
||||
false
|
||||
true
|
||||
> Ox.isEqual(document.getElementsByTagName('a'), document.getElementsByTagName('a'))
|
||||
true
|
||||
> Ox.isEqual(null, null)
|
||||
|
@ -136,7 +136,8 @@ Ox.isEqual = function(a, b) {
|
|||
// 0 === -0, but not equal
|
||||
ret = a !== 0 || 1 / a === 1 / b;
|
||||
} else if (type == Ox.typeOf(b)) {
|
||||
if (a == b) {
|
||||
// NaN !== NaN, but equal
|
||||
if (a == b || a !== b) {
|
||||
ret = true;
|
||||
} else if (type == 'date') {
|
||||
ret = +a == +b;
|
||||
|
|
Loading…
Reference in a new issue