Skip to content

Commit

Permalink
Use .indexOf instead of .includes for IE compat; lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjana Vakil committed Jul 29, 2019
1 parent 51ba9bb commit 20b8146
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/data/bucket/symbol_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ class SymbolBucket implements Bucket {
if (text) {
const fontStack = textFont.evaluate(feature, {}).join(',');
const textAlongLine = layout.get('text-rotation-alignment') === 'map' && layout.get('symbol-placement') !== 'point';
this.allowVerticalPlacement = this.writingModes && this.writingModes.includes(WritingMode.vertical);
this.allowVerticalPlacement = this.writingModes && this.writingModes.indexOf(WritingMode.vertical) >= 0;
for (const section of text.sections) {
const doesAllowVerticalWritingMode = allowsVerticalWritingMode(text.toString());
const sectionFont = section.fontStack || fontStack;
Expand Down
2 changes: 1 addition & 1 deletion src/style/style_layer/symbol_style_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SymbolStyleLayer extends StyleLayer {
// remove duplicates, preserving order
const deduped = [];
for (const m of writingModes) {
if (!(deduped.includes(m))) deduped.push(m);
if (deduped.indexOf(m) < 0) deduped.push(m);
}
this.layout._values['text-writing-mode'] = deduped;
} else {
Expand Down
1 change: 0 additions & 1 deletion src/symbol/placement.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@ export class Placement {
bucket.text.placedSymbolArray.get(symbolInstance.verticalPlacedTextSymbolIndex).hidden = symbolHidden || verticalHidden;
}


const prevOffset = this.variableOffsets[symbolInstance.crossTileID];
if (prevOffset) {
this.markUsedJustification(bucket, prevOffset.anchor, symbolInstance, placedOrientation);
Expand Down

0 comments on commit 20b8146

Please sign in to comment.