Morten Sørvig f5231e2dbb wasm: implement promise handler using suspendresumecontrol
This is required to make sure we resume the wasm instance
when a promise resolves. As a bonus QWasmSuspendResumeControl
already implements the JS -> C++ callback mapping, and
we can removed the fixed-4 ThunkPool which the current
implementation is using.

The implementation is straightforward, where the only
snag is that cleanup must be done in the finally callback.

Implement Promise::all by calling JS Promise.all(). This
function returns a new Promise, which we can adopt.

Make two changes to the test:

- remove throwInThen(): We no longer support propagating
  JS exceptions from the then() handler to the catch function.
  (catching a rejected promise still works). As far as
  I can see this functionality is not used in qtbase.

- In finallyWithThen(), change shared_ptr<bool> to plain
  pointer. This works around a (mysterious) issue where we
  were not getting the correct value when reading from the
  shared_ptr.

Change-Id: I8fb11b66ecba74f80708bd39eeeac59bb62f3786
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
2025-04-15 18:31:47 +02:00
..
2024-12-02 19:45:18 +01:00
2024-02-04 09:56:42 +01:00