Remove hidden unused squared argument in Point#getLength()

This commit is contained in:
Jürg Lehni 2013-12-28 20:58:16 +01:00
parent 38d67d843d
commit 8711fcf500

View file

@ -467,11 +467,7 @@ var Point = Base.extend(/** @lends Point# */{
* @bean * @bean
*/ */
getLength: function() { getLength: function() {
// Supports a hidden parameter 'squared', which controls whether the return Math.sqrt(this.x * this.x + this.y * this.y);
// squared length should be returned. Hide it so it produces a bean
// property called #length.
var length = this.x * this.x + this.y * this.y;
return arguments.length && arguments[0] ? length : Math.sqrt(length);
}, },
setLength: function(length) { setLength: function(length) {