@returns {WastParser}
()
| 24 | |
| 25 | /** @returns {WastParser} */ |
| 26 | async function getWasmToolsParser() { |
| 27 | return async (filePath) => { |
| 28 | const fileName = basename(filePath, ".wat"); |
| 29 | const wasmPath = fileURLToPath( |
| 30 | new URL(`../../.cache/${fileName}.wasm`, import.meta.url) |
| 31 | ); |
| 32 | |
| 33 | // Use wasm-tools CLI to parse WAT into a WASM binary |
| 34 | await spawnPromise("wasm-tools", ["parse", filePath, "-o", wasmPath]); |
| 35 | }; |
| 36 | } |
| 37 | |
| 38 | export async function getWastParser() { |
| 39 | try { |
no test coverage detected