generated at
JavaScript Promise Integration API
WebAssembly非同期処理を返す実験的実装

chrome: chrome://flags/#enable-experimental-webassembly-jspi
firefox: javascript.options.wasm_js_promise_integration
safari: not supported
Deno: --v8-flags=--experimental-wasm-jspi
JS以外のruntimeでは使えない

使い方
importしたい非同期函数を、 new WebAssembly.Suspending() でwrapしてWebAssembly.importObjectsにいれる
exportした函数を非同期に呼び出すときは、 WebAssembly.promising() を通してasync functionを得る


おそらく現行のAsyncifyに代わるものとして仕様策定が進められている

#2024-08-18 15:46:46
#2024-08-09 12:32:01