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

Issue 1966523003: Make _Future._chainForeignFuture not cause an assert. (Closed)

Created:
4 years, 7 months ago by Lasse Reichstein Nielsen
Modified:
4 years, 7 months ago
Reviewers:
floitsch
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Make _Future._chainForeignFuture not cause an assert. If the foreign future completes with a future, the following call to _Future._completeWithValue would hit an assert in checked mode (value is! Future). This change makes the _Future._completeWithValue flatten incoming nesting futures before completing the _Future, ensuring that a _Future never has a Future as value. An alternative is to throw if the value of a future is another future. That's what the assert does in checked mode, but we shouldn't be able to hit an assert. R=floitsch@google.com Committed: https://github.com/dart-lang/sdk/commit/63b71b4c241e8dbfa62fbb10aec71afe8e592694

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -4 lines) Patch
M sdk/lib/async/future_impl.dart View 1 4 chunks +12 lines, -3 lines 0 comments Download
M tests/lib/async/future_test.dart View 1 4 chunks +43 lines, -1 line 0 comments Download

Messages

Total messages: 6 (2 generated)
Lasse Reichstein Nielsen
4 years, 7 months ago (2016-05-10 08:41:56 UTC) #2
floitsch
LGTM. https://codereview.chromium.org/1966523003/diff/1/sdk/lib/async/future_impl.dart File sdk/lib/async/future_impl.dart (right): https://codereview.chromium.org/1966523003/diff/1/sdk/lib/async/future_impl.dart#newcode415 sdk/lib/async/future_impl.dart:415: // so use _complete in stead of _completeWithValue. ...
4 years, 7 months ago (2016-05-10 15:39:51 UTC) #3
Lasse Reichstein Nielsen
https://codereview.chromium.org/1966523003/diff/1/sdk/lib/async/future_impl.dart File sdk/lib/async/future_impl.dart (right): https://codereview.chromium.org/1966523003/diff/1/sdk/lib/async/future_impl.dart#newcode415 sdk/lib/async/future_impl.dart:415: // so use _complete in stead of _completeWithValue. On ...
4 years, 7 months ago (2016-05-11 10:19:37 UTC) #4
Lasse Reichstein Nielsen
4 years, 7 months ago (2016-05-11 11:14:12 UTC) #6
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
63b71b4c241e8dbfa62fbb10aec71afe8e592694 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698