Skip to content

Commit

Permalink
Clean up change to resolved images
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamley committed Feb 26, 2020
1 parent c4df124 commit 2966ae4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/style-spec/expression/definitions/coercion.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class Coercion implements Expression {
// created by properties that expect the 'formatted' type.
return Formatted.fromString(valueToString(this.args[0].evaluate(ctx)));
} else if (this.type.kind === 'resolvedImage') {
return ResolvedImage.fromString(valueToString(this.args[0].evaluate(ctx)), ctx.availableImages);
return ResolvedImage.fromString(valueToString(this.args[0].evaluate(ctx)));
} else {
return valueToString(this.args[0].evaluate(ctx));
}
Expand Down
5 changes: 2 additions & 3 deletions src/style-spec/expression/types/resolved_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ export default class ResolvedImage {
return this.name;
}

static fromString(name: string, availableImages?: ?Array<string>): ResolvedImage {
const available = availableImages ? availableImages.indexOf(name) > -1 : false;
return new ResolvedImage({name, available});
static fromString(name: string): ResolvedImage {
return new ResolvedImage({name, available: false});
}

serialize(): Array<string> {
Expand Down

0 comments on commit 2966ae4

Please sign in to comment.