Clean up Point#equals() code.

This commit is contained in:
Jürg Lehni 2014-02-20 15:37:38 +01:00
parent 5e7b15c64e
commit d9efb888bc

View file

@ -199,10 +199,11 @@ var Point = Base.extend(/** @lends Point# */{
* console.log(point != new Point(1, 1)); // true
*/
equals: function(point) {
return point === this || point && (this.x === point.x
&& this.y === point.y
|| Array.isArray(point) && this.x === point[0]
&& this.y === point[1]) || false;
return this === point || point
&& (this.x === point.x && this.y === point.y
|| Array.isArray(point)
&& this.x === point[0] && this.y === point[1])
|| false;
},
/**