diff --git a/source/Ox/js/Geo.js b/source/Ox/js/Geo.js index 69cce318..b82b63bb 100644 --- a/source/Ox/js/Geo.js +++ b/source/Ox/js/Geo.js @@ -142,7 +142,7 @@ /*@ Ox.getLatLngByXY Returns lat/lng for a given x/y on a 1x1 mercator projection > Ox.getLatLngByXY({x: 0.5, y: 0.5}) - {lat: 0, lng: 0} + {lat: -0, lng: 0} @*/ Ox.getLatLngByXY = function(xy) { function getValue(value) { diff --git a/source/Ox/js/Type.js b/source/Ox/js/Type.js index 780b96e1..651136ea 100644 --- a/source/Ox/js/Type.js +++ b/source/Ox/js/Type.js @@ -111,6 +111,8 @@ Ox.isEqual Returns true if two values are equal false > Ox.isEqual(0, 0) true + > Ox.isEqual(-0, +0) + false > Ox.isEqual({}, {}) true > Ox.isEqual({a: 1, b: 2, c: 3}, {c: 3, b: 2, a: 1}) @@ -128,9 +130,9 @@ Ox.isEqual Returns true if two values are equal @*/ Ox.isEqual = function(a, b) { var ret = false, type = Ox.typeOf(a); - // 0 === -0, but not equal - if (a === b && (a !== 0 || 1 / a === 1 / b)) { - ret = true; + if (a === b) { + // 0 === -0, but not equal + ret = a !== 0 || 1 / a === 1 / b; } else if (type == Ox.typeOf(b)) { if (a == b) { ret = true;