diff --git a/src/color/GradientStop.js b/src/color/GradientStop.js index f4bbbbfd..9a5d815e 100644 --- a/src/color/GradientStop.js +++ b/src/color/GradientStop.js @@ -30,19 +30,22 @@ var GradientStop = this.GradientStop = Base.extend(/** @lends GradientStop# */{ */ initialize: function(arg0, arg1) { if (arg0) { + var color, rampPoint; if (arg1 === undefined && Array.isArray(arg0)) { // [color, rampPoint] - this.setColor(arg0[0]); - this.setRampPoint(arg0[1]); - } else if (arg0 && arg0.color) { + color = arg0[0]; + rampPoint = arg0[1]; + } else if (arg0.color) { // stop - this.setColor(arg0.color); - this.setRampPoint(arg0.rampPoint); + color = arg0.color; + rampPoint = arg0.rampPoint; } else { - // color [, rampPoint] - this.setColor(arg0); - this.setRampPoint(arg1); + // color, rampPoint + color = arg0; + rampPoint = arg1; } + this.setColor(color); + this.setRampPoint(rampPoint); } },