@@ -46,7 +46,7 @@ export default class JsExecutor {
46
46
compilerVersion ,
47
47
) {
48
48
if ( platform === TargetPlatforms . SWIFT_EXPORT ) {
49
- return `<span class=" standard-output ${ theme } " ><div class=" result-code" >${ jsCode } </span>` ;
49
+ return `<span class=' standard-output ${ theme } ' ><div class=' result-code' >${ jsCode } </span>` ;
50
50
}
51
51
if ( platform === TargetPlatforms . CANVAS ) {
52
52
this . iframe . style . display = 'block' ;
@@ -119,14 +119,14 @@ export default class JsExecutor {
119
119
try {
120
120
const output = this . iframe . contentWindow . eval ( jsCode ) ;
121
121
return output
122
- ? `<span class=" standard-output ${ theme } " >${ processingHtmlBrackets (
122
+ ? `<span class=' standard-output ${ theme } ' >${ processingHtmlBrackets (
123
123
output ,
124
124
) } </span>`
125
125
: '' ;
126
126
} catch ( e ) {
127
127
if ( onError ) onError ( ) ;
128
128
let exceptionOutput = showJsException ( e ) ;
129
- return `<span class=" error-output" >${ exceptionOutput } </span>` ;
129
+ return `<span class=' error-output' >${ exceptionOutput } </span>` ;
130
130
}
131
131
}
132
132
await this . timeout ( 400 ) ;
@@ -160,14 +160,14 @@ export default class JsExecutor {
160
160
const outputString = bufferedOutput . buffer ;
161
161
bufferedOutput . buffer = '' ;
162
162
return outputString
163
- ? `<span class=" standard-output ${ theme } " >${ processingHtmlBrackets (
163
+ ? `<span class=' standard-output ${ theme } ' >${ processingHtmlBrackets (
164
164
outputString ,
165
165
) } </span>`
166
166
: '' ;
167
167
} catch ( e ) {
168
168
if ( onError ) onError ( ) ;
169
169
let exceptionOutput = showJsException ( e ) ;
170
- return `<span class=" error-output" >${ exceptionOutput } </span>` ;
170
+ return `<span class=' error-output' >${ exceptionOutput } </span>` ;
171
171
}
172
172
}
173
173
@@ -240,7 +240,7 @@ export default class JsExecutor {
240
240
// necessary to load stdlib.wasm before its initialization to parallelize
241
241
// language=JavaScript
242
242
(
243
- `const stdlibWasm = fetch('${ API_URLS . STDLIB_WASM ( stdlibVersion ) } ');\n ` +
243
+ `const stdlibWasm = fetch('${ API_URLS . STDLIB_WASM ( stdlibVersion ) } '); ` +
244
244
script
245
245
)
246
246
. replace (
@@ -251,6 +251,9 @@ export default class JsExecutor {
251
251
'(extends) => { return { extends }; }' ,
252
252
'(extends_) => { return { extends_ }; }' ,
253
253
) ,
254
+ )
255
+ . then ( ( stdlibCode ) =>
256
+ executeWasmCodeWithSkiko ( this . iframe . contentWindow , stdlibCode ) ,
254
257
) ;
255
258
256
259
return Promise . all ( [ skikoExports , stdlibExports ] ) ;
@@ -273,7 +276,7 @@ export default class JsExecutor {
273
276
} ) ;
274
277
275
278
this . iframe . height = '1000' ;
276
- iframeDoc . write ( `<canvas height=" 1000" id=" ComposeTarget" ></canvas>` ) ;
279
+ iframeDoc . write ( `<canvas height=' 1000' id=' ComposeTarget' ></canvas>` ) ;
277
280
}
278
281
iframeDoc . write ( '<body style="margin: 0; overflow: hidden;"></body>' ) ;
279
282
iframeDoc . close ( ) ;
0 commit comments