File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -780,25 +780,22 @@ class CompiledFont {
780780
781781 getPathJs ( unicode ) {
782782 const { charCode, glyphId } = lookupCmap ( this . cmap , unicode ) ;
783- let fn = this . compiledGlyphs [ glyphId ] ;
783+ let fn = this . compiledGlyphs [ glyphId ] ,
784+ compileEx ;
784785 if ( ! fn ) {
785786 try {
786- fn = this . compiledGlyphs [ glyphId ] = this . compileGlyph (
787- this . glyphs [ glyphId ] ,
788- glyphId
789- ) ;
787+ fn = this . compileGlyph ( this . glyphs [ glyphId ] , glyphId ) ;
790788 } catch ( ex ) {
791- // Avoid attempting to re-compile a corrupt glyph.
792- this . compiledGlyphs [ glyphId ] = NOOP ;
789+ fn = NOOP ; // Avoid attempting to re-compile a corrupt glyph.
793790
794- if ( this . compiledCharCodeToGlyphId [ charCode ] === undefined ) {
795- this . compiledCharCodeToGlyphId [ charCode ] = glyphId ;
796- }
797- throw ex ;
791+ compileEx = ex ;
798792 }
793+ this . compiledGlyphs [ glyphId ] = fn ;
799794 }
800- if ( this . compiledCharCodeToGlyphId [ charCode ] === undefined ) {
801- this . compiledCharCodeToGlyphId [ charCode ] = glyphId ;
795+ this . compiledCharCodeToGlyphId [ charCode ] ??= glyphId ;
796+
797+ if ( compileEx ) {
798+ throw compileEx ;
802799 }
803800 return fn ;
804801 }
You can’t perform that action at this time.
0 commit comments