Chromium Code Reviews
DescriptionKernel: Fix a bug with await in finally.
The translation for async and async* functions translates returns into
two statements, where the second one is a return. The VM's compilation
strategy is to inline the code for all finally blocks immediately before
a return statement.
This causes future completion/stream cancellation to occur before
finally blocks, instead of after as intended.
The solution here is to translate returns into a break from a labeled
block and put a single async/async* return sequence, outside any finally
blocks, after the labeled block.
BUG=
R=asgerf@google.com
Committed: https://github.com/dart-lang/kernel/commit/290f955760a219902e4d5b716668bff29711d1ab
Patch Set 1 #
Total comments: 2
Patch Set 2 : Copy the fileOffset from the ReturnStatement. #Messages
Total messages: 8 (3 generated)
|