Skip to content

Commit

Permalink
Remove unused literal value serialization of Collator.
Browse files Browse the repository at this point in the history
We no longer constant-fold Collator expressions, so there's no way to create a literal holding a Collator.
  • Loading branch information
ChrisLoer committed May 2, 2018
1 parent 8926c34 commit fa9c59d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
10 changes: 0 additions & 10 deletions src/style-spec/expression/definitions/collator.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@ export class Collator {
return new Intl.Collator(this.locale ? this.locale : [])
.resolvedOptions().locale;
}

serialize() {
const options = {};
options['caseSensitive'] = this.sensitivity === 'variant' || this.sensitivity === 'case';
options['diacriticSensitive'] = this.sensitivity === 'variant' || this.sensitivity === 'accent';
if (this.locale) {
options['locale'] = this.locale;
}
return ["collator", options];
}
}

export class CollatorExpression implements Expression {
Expand Down
4 changes: 0 additions & 4 deletions src/style-spec/expression/definitions/literal.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ class Literal implements Expression {
// couldn't actually generate with a "literal" expression,
// so we have to implement an equivalent serialization here
return ["rgba"].concat(this.value.toArray());
} else if (this.value instanceof Collator) {
// Same as Color above: literal serialization delegated to
// Collator (not CollatorExpression)
return this.value.serialize();
} else {
assert(this.value === null ||
typeof this.value === 'string' ||
Expand Down

0 comments on commit fa9c59d

Please sign in to comment.