Skip to content

Commit

Permalink
Fix compiled js for curve with single stop
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand Thakker committed Jun 22, 2017
1 parent 568d1dc commit 3f1ef06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/style-spec/function/expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ const expressions: { [string]: Definition } = {
}

stops.push(input.value);
outputs.push(`() => ${output.js}`);
outputs.push(output.js);
}

if (stops.length === 1) return {js: `${outputs[0]}`};
Expand All @@ -345,7 +345,7 @@ const expressions: { [string]: Definition } = {
(function () {
var input = ${args[1].js};
var stopInputs = [${stops.join(', ')}];
var stopOutputs = [${outputs.join(', ')}];
var stopOutputs = [${outputs.map(o => `() => ${o}`).join(', ')}];
return this.evaluateCurve(${args[1].js}, stopInputs, stopOutputs, ${JSON.stringify(interpolationOptions)}, ${JSON.stringify(resultType)});
}.bind(this))()`};
}
Expand Down

0 comments on commit 3f1ef06

Please sign in to comment.