mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Point#getLength: access to out of bounds index in arguments array prevented function from being optimized.
This commit is contained in:
parent
8cc82917c9
commit
2a0f322c22
1 changed files with 1 additions and 1 deletions
|
@ -428,7 +428,7 @@ var Point = this.Point = Base.extend(/** @lends Point# */{
|
||||||
// squared length should be returned. Hide it so it produces a bean
|
// squared length should be returned. Hide it so it produces a bean
|
||||||
// property called #length.
|
// property called #length.
|
||||||
var l = this.x * this.x + this.y * this.y;
|
var l = this.x * this.x + this.y * this.y;
|
||||||
return arguments[0] ? l : Math.sqrt(l);
|
return (arguments.length && arguments[0]) ? l : Math.sqrt(l);
|
||||||
},
|
},
|
||||||
|
|
||||||
setLength: function(length) {
|
setLength: function(length) {
|
||||||
|
|
Loading…
Reference in a new issue