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

Side by Side Diff: tests/lib/async/catch_errors.dart

Issue 17064008: Revert "Zone support for Futures." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/async/zone.dart ('k') | tests/lib/async/catch_errors10_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 library catch_errors;
2
3 import 'dart:async';
4
5 Stream catchErrors(void body()) {
6 StreamController controller;
7
8 bool onError(e) {
9 controller.add(e);
10 return true;
11 }
12
13 void onDone() {
14 controller.close();
15 }
16
17 void onListen() {
18 runZonedExperimental(body, onError: onError, onDone: onDone);
19 }
20
21 controller = new StreamController(onListen: onListen);
22 return controller.stream;
23 }
24
25 Future waitForCompletion(void body()) {
26 Completer completer = new Completer.sync();
27 runZonedExperimental(body, onDone: completer.complete);
28 return completer.future;
29 }
OLDNEW
« no previous file with comments | « sdk/lib/async/zone.dart ('k') | tests/lib/async/catch_errors10_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698