* \brief Compiles a module from the WebAssembly text format. * * This function will automatically use `wat2wasm` on the input and then * delegate to the #compile function. */
| 38 | * delegate to the #compile function. |
| 39 | */ |
| 40 | static Result<Module> compile(Engine &engine, std::string_view wat) { |
| 41 | auto wasm = wat2wasm(wat); |
| 42 | if (!wasm) { |
| 43 | return wasm.err(); |
| 44 | } |
| 45 | auto bytes = wasm.ok(); |
| 46 | return compile(engine, bytes); |
| 47 | } |
| 48 | #endif // WASMTIME_FEATURE_WAT |
| 49 | |
| 50 | /** |