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)
|
> Ox.isEqual(Infinity, -Infinity)
|
||||||
false
|
false
|
||||||
> Ox.isEqual(NaN, NaN)
|
> Ox.isEqual(NaN, NaN)
|
||||||
false
|
true
|
||||||
> Ox.isEqual(document.getElementsByTagName('a'), document.getElementsByTagName('a'))
|
> Ox.isEqual(document.getElementsByTagName('a'), document.getElementsByTagName('a'))
|
||||||
true
|
true
|
||||||
> Ox.isEqual(null, null)
|
> Ox.isEqual(null, null)
|
||||||
|
@ -136,7 +136,8 @@ Ox.isEqual = function(a, b) {
|
||||||
// 0 === -0, but not equal
|
// 0 === -0, but not equal
|
||||||
ret = a !== 0 || 1 / a === 1 / b;
|
ret = a !== 0 || 1 / a === 1 / b;
|
||||||
} else if (type == Ox.typeOf(b)) {
|
} else if (type == Ox.typeOf(b)) {
|
||||||
if (a == b) {
|
// NaN !== NaN, but equal
|
||||||
|
if (a == b || a !== b) {
|
||||||
ret = true;
|
ret = true;
|
||||||
} else if (type == 'date') {
|
} else if (type == 'date') {
|
||||||
ret = +a == +b;
|
ret = +a == +b;
|
||||||
|
|
Loading…
Reference in a new issue