Skip to content

Commit

Permalink
Describe new async/async*/sync* implementation in CHANGELOG.
Browse files Browse the repository at this point in the history
Issue: #48378
Change-Id: I0cfff561a06c402603ad4f2b977821b572cb6e21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250408
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
  • Loading branch information
alexmarkov authored and Commit Bot committed Jul 6, 2022
1 parent 37a1052 commit 5a067e9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,29 @@

- Deprecates `BidirectionalIterator`.

### Dart VM

Implementation of `async`/`async*`/`sync*` is revamped in Dart VM,
both in JIT and AOT modes. This also affects Flutter except Flutter Web.

Besides smaller code size and better performance of async methods,
the new implementation carries a few subtle changes in behavior:

- If `async` method returns before reaching the first `await`, it now returns a completed Future.
Previously `async` methods completed resulting Future in separate microtasks.

- Stack traces no longer have duplicate entries for `async` methods.

- New implementation now correctly throws an error if `null` occurs as
an argument of a logical expression (`&&` and `||`) which also contains
an `await`.

- New implementation avoids unnecessary extending the liveness of local
variables in `async`/`async*`/`sync*` methods, which means that unused
objects stored in local variables in such methods might be garbage
collected earlier than they were before
(see issue [#36983](https://github.com/dart-lang/sdk/issues/36983) for details).

## 2.18.0

### Language
Expand Down

0 comments on commit 5a067e9

Please sign in to comment.