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

Issue 11818013: Fix Futures.wait. (Closed)

Created:
7 years, 11 months ago by nweiz
Modified:
7 years, 11 months ago
CC:
reviews_dartlang.org, Bob Nystrom, Anders Johnsen
Visibility:
Public.

Description

Fix Futures.wait. The old implementation would throw any errors emitted by any sub-future to the top level. Committed: https://code.google.com/p/dart/source/detail?r=16881

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -4 lines) Patch
M sdk/lib/async/future_impl.dart View 2 chunks +4 lines, -3 lines 2 comments Download
M tests/lib/async/futures_test.dart View 3 chunks +49 lines, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
nweiz
7 years, 11 months ago (2013-01-09 03:52:07 UTC) #1
floitsch
LGTM.
7 years, 11 months ago (2013-01-09 10:06:35 UTC) #2
Bob Nystrom
LGTM. Nice catch.
7 years, 11 months ago (2013-01-09 16:10:59 UTC) #3
Anders Johnsen
DBC https://codereview.chromium.org/11818013/diff/1/sdk/lib/async/future_impl.dart File sdk/lib/async/future_impl.dart (right): https://codereview.chromium.org/11818013/diff/1/sdk/lib/async/future_impl.dart#newcode118 sdk/lib/async/future_impl.dart:118: completer.complete(values); This should be 'if (completed) ...;' too, ...
7 years, 11 months ago (2013-01-10 06:40:40 UTC) #4
nweiz
7 years, 11 months ago (2013-01-10 19:20:28 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/11818013/diff/1/sdk/lib/async/future_impl.dart
File sdk/lib/async/future_impl.dart (right):

https://codereview.chromium.org/11818013/diff/1/sdk/lib/async/future_impl.dar...
sdk/lib/async/future_impl.dart:118: completer.complete(values);
On 2013/01/10 06:40:40, Anders Johnsen wrote:
> This should be 'if (completed) ...;' too, if we want to handle:
> 
> c1.completeError('correct error');
> c2.complete(myValue);

Currently "remaining" never hits zero if any of the futures have an error, so
the completer won't double-complete even in this case.

Powered by Google App Engine
This is Rietveld 408576698