@@ -478,11 +478,11 @@ export class SymbolBucket implements Bucket {
478478 const formattedText = Formatted . factory ( resolvedTokens ) ;
479479
480480 // on this instance: if hasRTLText is already true, all future calls to containsRTLText can be skipped.
481- const bucketHasRTLText = this . hasRTLText = ( this . hasRTLText || containsRTLText ( formattedText ) ) ;
481+ this . hasRTLText ||= containsRTLText ( formattedText ) ;
482482 if (
483- ! bucketHasRTLText || // non-rtl text so can proceed safely
483+ ! this . hasRTLText || // non-rtl text so can proceed safely
484484 rtlWorkerPlugin . getRTLTextPluginStatus ( ) === 'unavailable' || // We don't intend to lazy-load the rtl text plugin, so proceed with incorrect shaping
485- bucketHasRTLText && rtlWorkerPlugin . isParsed ( ) // Use the rtlText plugin to shape text
485+ this . hasRTLText && rtlWorkerPlugin . isParsed ( ) // Use the rtlText plugin to shape text
486486 ) {
487487 text = transformText ( formattedText , layer , evaluationFeature ) ;
488488 }
@@ -533,8 +533,8 @@ export class SymbolBucket implements Bucket {
533533 if ( ! section . image ) {
534534 const doesAllowVerticalWritingMode = allowsVerticalWritingMode ( text . toString ( ) ) ;
535535 const sectionFont = section . fontStack || fontStack ;
536- const sectionStack = stacks [ sectionFont ] = stacks [ sectionFont ] || { } ;
537- this . calculateGlyphDependencies ( section . text , sectionStack , textAlongLine , this . allowVerticalPlacement , doesAllowVerticalWritingMode ) ;
536+ stacks [ sectionFont ] ||= { } ;
537+ this . calculateGlyphDependencies ( section . text , stacks [ sectionFont ] , textAlongLine , this . allowVerticalPlacement , doesAllowVerticalWritingMode ) ;
538538 } else {
539539 // Add section image to the list of dependencies.
540540 icons [ section . image . name ] = true ;
@@ -544,7 +544,7 @@ export class SymbolBucket implements Bucket {
544544 }
545545
546546 if ( layout . get ( 'symbol-placement' ) === 'line' ) {
547- // Merge adjacent lines with the same text to improve labelling .
547+ // Merge adjacent lines with the same text to improve labeling .
548548 // It's better to place labels on one long line than on many short segments.
549549 this . features = mergeLines ( this . features ) ;
550550 }
0 commit comments