File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -389,20 +389,15 @@ function compilePatternInfo(ir) {
389389}
390390
391391function compileFontPathInfo ( path ) {
392- let data ;
393- let buffer ;
394- if (
395- ( typeof PDFJSDev !== "undefined" && PDFJSDev . test ( "MOZCENTRAL" ) ) ||
396- FeatureTest . isFloat16ArraySupported
397- ) {
398- buffer = new ArrayBuffer ( path . length * 2 ) ;
399- data = new Float16Array ( buffer ) ;
400- } else {
401- buffer = new ArrayBuffer ( path . length * 4 ) ;
402- data = new Float32Array ( buffer ) ;
392+ if ( typeof PDFJSDev === "undefined" || PDFJSDev . test ( "TESTING" ) ) {
393+ assert (
394+ FeatureTest . isFloat16ArraySupported
395+ ? path instanceof Float16Array
396+ : path instanceof Float32Array ,
397+ "compileFontPathInfo: Unexpected path format."
398+ ) ;
403399 }
404- data . set ( path ) ;
405- return buffer ;
400+ return path . slice ( ) . buffer ;
406401}
407402
408403export {
You can’t perform that action at this time.
0 commit comments