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

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

Issue 32553003: Remove default value in factory constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library event_helper; 5 library event_helper;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 abstract class Event { 9 abstract class Event {
10 void replay(EventSink sink); 10 void replay(EventSink sink);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 Events(); 67 Events();
68 68
69 Events.fromIterable(Iterable iterable) { 69 Events.fromIterable(Iterable iterable) {
70 for (var value in iterable) add(value); 70 for (var value in iterable) add(value);
71 close(); 71 close();
72 } 72 }
73 73
74 /** Capture events from a stream into a new [Events] object. */ 74 /** Capture events from a stream into a new [Events] object. */
75 factory Events.capture(Stream stream, 75 factory Events.capture(Stream stream,
76 { bool cancelOnError: false }) = CaptureEvents; 76 { bool cancelOnError }) = CaptureEvents;
77 77
78 // EventSink interface. 78 // EventSink interface.
79 void add(var value) { 79 void add(var value) {
80 if (trace) print("Events#$hashCode: add($value)"); 80 if (trace) print("Events#$hashCode: add($value)");
81 events.add(new DataEvent(value)); 81 events.add(new DataEvent(value));
82 } 82 }
83 83
84 void addError(error, [StackTrace stackTrace]) { 84 void addError(error, [StackTrace stackTrace]) {
85 if (trace) print("Events#$hashCode: addError($error)"); 85 if (trace) print("Events#$hashCode: addError($error)");
86 events.add(new ErrorEvent(error)); 86 events.add(new ErrorEvent(error));
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 void resume() { 173 void resume() {
174 if (trace) print("Events#$hashCode: resume"); 174 if (trace) print("Events#$hashCode: resume");
175 subscription.resume(); 175 subscription.resume();
176 } 176 }
177 177
178 void onDone(void action()) { 178 void onDone(void action()) {
179 if (trace) print("Events#$hashCode: onDone"); 179 if (trace) print("Events#$hashCode: onDone");
180 super.onDone(action); 180 super.onDone(action);
181 } 181 }
182 } 182 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698