| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b192227 commit df93cb4
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,8 @@ const buffer = fs.readFileSync(modulePath); | |||
| 21 | 21 | // Verify that if a WASI application throws an exception, Node rethrows it | |
| 22 | 22 | // properly. | |
| 23 | 23 | const wasi = new WASI({ returnOnExit: true }); | |
| 24 | - wasi.wasiImport.proc_exit = () => { throw new Error('test error'); }; | ||
| 24 | + const patchedExit = () => { throw new Error('test error'); }; | ||
| 25 | + wasi.wasiImport.proc_exit = patchedExit.bind(wasi.wasiImport); | ||
| 25 | 26 | const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; | |
| 26 | 27 | const { instance } = await WebAssembly.instantiate(buffer, importObject); | |
| 27 | 28 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments