DDC passes, dart2js and VM fail.
----
The dart2js and VM fringe-following scheme could be modified to call
`.iterator` at the `yield*` site and use the Iterator instead of the Iterable.
Calling `.iterator` at the `yield*` site would move the exception to the right place. It might also present an optimization opportunity where the call might be inlined, or the entry into the fringe-following algorithm could be made more efficient based on the type of the iterator.
Change-Id: Icfb6f7ca0b92cbeea1349ce138e469cfa707f571
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295200
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
This adds a mechanism similar to that used in async functions where
exceptions are caught in the synthetic code and passed into the
generated body to be rethrow'n.
This ensures the exception is throw'n from the same place as the
original yield*, as per the spec.
Bug: https://github.com/dart-lang/sdk/issues/42466
Change-Id: I054b9db568a49b046b6bb49f3e775bf093f83950
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160221
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Makes the synthetic sync* iterator dynamic to allow the internal,
synthetic sync* code to handle nested iterators of differing types.
Bug: https://github.com/dart-lang/sdk/issues/42234
Change-Id: I309885b27555142cd7f8ab13a5637b35545f1d44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160071
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
This reverts commit 358aee331b.
Reason for revert: Appears to break service/async_generator_breakpoint_test
Original change's description:
> [VM] Fixes yield* exception handling in sync*.
>
> This adds a mechanism similar to that used in async functions where
> exceptions are caught in the synthetic code and passed into the
> generated body to be rethrow'n.
> This ensures the exception is throw'n from the same place as the
> original yield*, as per the spec.
>
> Bug: https://github.com/dart-lang/sdk/issues/42466
> Change-Id: I553dd89141985f6f30751913a1c8a62b1229af04
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158543
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
TBR=vegorov@google.com,cskau@google.com
Change-Id: I9df83543d41d4260e91e4a7fb8df7c2762b92429
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/42466
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160101
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
This adds a mechanism similar to that used in async functions where
exceptions are caught in the synthetic code and passed into the
generated body to be rethrow'n.
This ensures the exception is throw'n from the same place as the
original yield*, as per the spec.
Bug: https://github.com/dart-lang/sdk/issues/42466
Change-Id: I553dd89141985f6f30751913a1c8a62b1229af04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158543
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Change-Id: I7a2bcc85731e426c6d0073d65c06878f917d6627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154681
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>