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

Issue 11418104: Make exceptions propagate through multiple Future branches. (Closed)

Created:
8 years, 1 month ago by nweiz
Modified:
8 years, 1 month ago
CC:
reviews_dartlang.org, Anders Johnsen, Bob Nystrom
Visibility:
Public.

Description

Make exceptions propagate through multiple Future branches. Committed: https://code.google.com/p/dart/source/detail?r=15221

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -7 lines) Patch
M sdk/lib/core/future_impl.dart View 8 chunks +21 lines, -7 lines 0 comments Download
M tests/corelib/future_test.dart View 2 chunks +88 lines, -0 lines 6 comments Download

Messages

Total messages: 4 (0 generated)
nweiz
By way of background, this fixes an issue I ran into while writing tests for ...
8 years, 1 month ago (2012-11-21 00:46:43 UTC) #1
Siggi Cherem (dart-lang)
thanks Nathan - overall looks good, just a couple comments https://codereview.chromium.org/11418104/diff/1/tests/corelib/future_test.dart File tests/corelib/future_test.dart (right): https://codereview.chromium.org/11418104/diff/1/tests/corelib/future_test.dart#newcode610 ...
8 years, 1 month ago (2012-11-21 01:08:57 UTC) #2
floitsch
LGTM. We will change the Future interface, but propagating errors to all subscribers is part ...
8 years, 1 month ago (2012-11-21 10:16:41 UTC) #3
nweiz
8 years, 1 month ago (2012-11-21 20:39:09 UTC) #4
https://codereview.chromium.org/11418104/diff/1/tests/corelib/future_test.dart
File tests/corelib/future_test.dart (right):

https://codereview.chromium.org/11418104/diff/1/tests/corelib/future_test.dar...
tests/corelib/future_test.dart:610: Expect.listEquals([2, 1], results);
On 2012/11/21 01:08:57, Siggi Cherem (dart-lang) wrote:
> it's weird to see these in opposite order, maybe use Expect.setEquals so that
we
> test only the relevant part?
> 
> (same in all other places)

Done.

https://codereview.chromium.org/11418104/diff/1/tests/corelib/future_test.dar...
tests/corelib/future_test.dart:639: var branch = completer.future.transform((_)
=> null);
On 2012/11/21 01:08:57, Siggi Cherem (dart-lang) wrote:
> maybe add another test to check what happens if you do the transform after
> adding 'handleException'? That is,
> 
> var base = completer.future;
> base.handleException((e) { results.add('base'); return true; });
> var branch = base.transform((_) => null);
> ...

That case isn't handled by this CL; it will actually stop the exception from
propagating. The correct behavior in that situation is a little less clear-cut.

https://codereview.chromium.org/11418104/diff/1/tests/corelib/future_test.dar...
tests/corelib/future_test.dart:695: testExceptionIsHandledInBaseAndBranch();
On 2012/11/21 01:08:57, Siggi Cherem (dart-lang) wrote:
> add the other 2 tests? (...AfterComplete)

Done.

Powered by Google App Engine
This is Rietveld 408576698