Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Issue 2790663003: Use FutureOr more and make Future.sync return the resulting Future directly. (Closed)

Created:
3 years, 8 months ago by Lasse Reichstein Nielsen
Modified:
3 years, 8 months ago
Reviewers:
floitsch
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Use FutureOr more and make Future.sync return the resulting Future directly. When the computation passed to Future.sync returns a Future of the correct type, then it's returned directly instead of wrapping it again. (Until strong mode, we have an extra case for when it returns a Future of an incorrect type, but that will eventually be removed). This should improve the performance of Future.sync a bit. Also adds missing Zone intercept for when the Future.sync computation throws. Updates documentation for Future.doWhile. Fixes #29202 BUG= http://dartbug.com/29202 R=floitsch@google.com Committed: https://github.com/dart-lang/sdk/commit/d509ddb3fa9d2fb62dd2ef94010cd5dadbbd966b

Patch Set 1 #

Patch Set 2 : State that doWhile completes with null. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -47 lines) Patch
M sdk/lib/async/future.dart View 1 7 chunks +36 lines, -24 lines 0 comments Download
M sdk/lib/async/future_impl.dart View 3 chunks +25 lines, -20 lines 0 comments Download
M tests/lib/async/future_test.dart View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
Lasse Reichstein Nielsen
3 years, 8 months ago (2017-03-31 08:53:05 UTC) #2
floitsch
LGTM.
3 years, 8 months ago (2017-03-31 10:40:49 UTC) #3
Lasse Reichstein Nielsen
3 years, 8 months ago (2017-03-31 10:41:13 UTC) #5
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
d509ddb3fa9d2fb62dd2ef94010cd5dadbbd966b (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698