File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -599,7 +599,8 @@ runtimeFunctions.tan = `const tan = (angle) => {
599599runtimeFunctions . resolveImageURL = `const resolveImageURL = imgURL =>
600600 typeof imgURL === 'object' && imgURL.type === 'canvas'
601601 ? Promise.resolve(imgURL.canvas)
602- : new Promise(resolve => {
602+ : new Promise(async resolve => {
603+ if (!await vm.securityManager.canFetch(imgUrl)) return resolve(imgURL);
603604 const image = new Image();
604605 image.crossOrigin = "anonymous";
605606 image.onload = resolve(image);
Original file line number Diff line number Diff line change @@ -2249,15 +2249,15 @@ class canvas {
22492249 code += `textMeasure = ${ ctx } .measureText(text);\n` ;
22502250 code += `${ cache } [text + ${ ctx } .font] = textMeasure;\n` ;
22512251 code += '}\n' ;
2252- code += 'return textMeasure. ' ;
2252+ code += 'return textMeasure[ ' ;
22532253 switch ( node . prop ) {
22542254 case 'height' :
2255- code += `actualBoundingBoxAscent + textMeasure. actualBoundingBoxDescent` ;
2255+ code += `' actualBoundingBoxAscent'] + textMeasure[' actualBoundingBoxDescent' ` ;
22562256 break ;
22572257 default :
2258- code += node . prop ;
2258+ code += JSON . stringify ( node . prop ) ;
22592259 }
2260- code += `;})(${ text } )` ;
2260+ code += `] ;})(${ text } )` ;
22612261
22622262 return new TypedInput ( code , TYPE_NUMBER ) ;
22632263 }
You can’t perform that action at this time.
0 commit comments