Optimise GradientStop constructor for better minification.

This commit is contained in:
Jürg Lehni 2012-12-18 13:49:29 +01:00
parent 15824e7aaf
commit 05ab8910ea

View file

@ -30,19 +30,22 @@ var GradientStop = this.GradientStop = Base.extend(/** @lends GradientStop# */{
*/ */
initialize: function(arg0, arg1) { initialize: function(arg0, arg1) {
if (arg0) { if (arg0) {
var color, rampPoint;
if (arg1 === undefined && Array.isArray(arg0)) { if (arg1 === undefined && Array.isArray(arg0)) {
// [color, rampPoint] // [color, rampPoint]
this.setColor(arg0[0]); color = arg0[0];
this.setRampPoint(arg0[1]); rampPoint = arg0[1];
} else if (arg0 && arg0.color) { } else if (arg0.color) {
// stop // stop
this.setColor(arg0.color); color = arg0.color;
this.setRampPoint(arg0.rampPoint); rampPoint = arg0.rampPoint;
} else { } else {
// color [, rampPoint] // color, rampPoint
this.setColor(arg0); color = arg0;
this.setRampPoint(arg1); rampPoint = arg1;
} }
this.setColor(color);
this.setRampPoint(rampPoint);
} }
}, },