Update the check for WebAssembly JSPI support

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>
This commit is contained in:
Stephan Bergmann 2024-11-04 17:36:03 +01:00
parent 3e1d5843f3
commit 78a011b9ba

View File

@ -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