File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const wasi = new WASI({
18
18
} ) ;
19
19
20
20
const buf = readFileSync ( WASM_PATH ) ;
21
- const wasiModule = await WebAssembly . compile ( new Uint8Array ( buf ) ) ;
21
+ const wasiModule = undefined ;
22
22
23
23
// Encode string into memory starting at address base.
24
24
const encode = ( memory , buffer ) => {
@@ -64,6 +64,7 @@ export class FontKitIndex {
64
64
* **NOTE**: You **MUST** CALL `.free()` when discarding FontKit.
65
65
*/
66
66
async initiate ( ) {
67
+ if ( ! wasiModule ) wasiModule = await WebAssembly . compile ( new Uint8Array ( buf ) ) ;
67
68
this . instance = await WebAssembly . instantiate ( wasiModule , { wasi_snapshot_preview1 : wasi . wasiImport } ) ;
68
69
wasi . initialize ( this . instance ) ;
69
70
this . fontkit_ptr = this . instance . exports . build_font_kit ( ) ;
You can’t perform that action at this time.
0 commit comments