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>