-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[dart2wasm] Asynchronous exception catching isn't working properly #55347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
area-dart2wasm
Issues for the dart2wasm compiler.
Comments
A slightly more distilled version:
It seems to be specific to having multiple |
osa1
added a commit
to osa1/sdk
that referenced
this issue
Apr 4, 2024
copybara-service bot
pushed a commit
that referenced
this issue
May 29, 2024
Loading
Loading status checks…
This cherry-picks commits: 6de879e - [dart2wasm] Fix exception handling in async functions 7e237a1 - [dart2wasm] Small refactoring in async code generator eabb2b3 - [dart2wasm] Catch JS exceptions in async functions e44bc22 - [dart2wasm] Fix bug in restoration of `this` in async functions. 350954a - [dart2wasm] Fix `this` restoration code in sync* handling. 8ccb412 - [dart2wasm] Move type parameter bounds checks & parameter type check logic together with logic setting up variables e7dde83 - [dart2wasm] Port VM fix for #52083 (sync*) 3863e78 - [dart2wasm] Move yield finder to a shared library 829261e - [dart2wasm] Move async compiler utilities to state_machine library fab56db - [dart2wasm] Move common code generation routines to state_machine, fix sync* Bugs: #55347, #55457, #51343, #51342 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/368300 Cherry-pick-request: #55847 Change-Id: I0a4186533fbdf4c5727911295ad48696a90f715f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368300 Commit-Queue: Ömer Ağacan <omersa@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is some code in flutter framework that is causing unit test failures when compiled to wasm. The issue seems to lie in this file: https://github.com/flutter/flutter/blob/38b2c5bf410b9b2ab52812acf7bbd924bf9386e2/packages/flutter/lib/src/services/platform_channel.dart#L568
I have created a more minimal reproducible sample of code that demonstrates this issue:
I don't know exactly what's going on yet, so it might be possible to distill it down further, but this does behave unexpectedly under dart2wasm. Running in the vm, we get the following output:
But in dart2wasm, the
MyException
escapes out and is not caught by theon MyException
block:The text was updated successfully, but these errors were encountered: