Skip to content

Commit

Permalink
Update the check for WebAssembly JSPI support
Browse files Browse the repository at this point in the history
At least Chrome 130 (after explicitly enabling "Experimental WebAssembly
JavaScript Promise Integration (JSPI)" in <chrome://flags/>) no longer has
WebAssembly.Function, but has WebAssembly.Suspending.  Which appears to be in
line with what is documented in the 2024-06-04 post at
<https://v8.dev/blog/jspi-newapi> "WebAssembly JSPI has a new API".

Change-Id: I6c777801482758864438879057917e2c5faa28a8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
  • Loading branch information
stbergmann committed Nov 21, 2024
1 parent 3e1d584 commit 78a011b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/corelib/platform/wasm/qstdweb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ void WebPromiseManager::adoptPromise(emscripten::val target, PromiseCallbacks ca

EM_JS(bool, jsHaveAsyncify, (), { return typeof Asyncify !== "undefined"; });
EM_JS(bool, jsHaveJspi, (),
{ return typeof Asyncify !== "undefined" && !!Asyncify.makeAsyncFunction && !!WebAssembly.Function; });
{ return typeof Asyncify !== "undefined" && !!Asyncify.makeAsyncFunction && (!!WebAssembly.Function || !!WebAssembly.Suspending); });

#else

Expand Down

0 comments on commit 78a011b

Please sign in to comment.