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

Side by Side Diff: sdk/lib/async/stream.dart

Issue 11826050: Consider a thrown AsyncError from a future/stream handler a rethrow. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Add tests. Created 7 years, 11 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/future_impl.dart ('k') | sdk/lib/async/stream_controller.dart » ('j') | 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 part of dart.async; 5 part of dart.async;
6 6
7 // ------------------------------------------------------------------- 7 // -------------------------------------------------------------------
8 // Core Stream types 8 // Core Stream types
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 10
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // Deprecated method, previously called 'pipe', retained for compatibility. 174 // Deprecated method, previously called 'pipe', retained for compatibility.
175 Future pipeInto(Sink<T> sink, 175 Future pipeInto(Sink<T> sink,
176 {void onError(AsyncError error), 176 {void onError(AsyncError error),
177 bool unsubscribeOnError}) { 177 bool unsubscribeOnError}) {
178 _FutureImpl<T> result = new _FutureImpl<T>(); 178 _FutureImpl<T> result = new _FutureImpl<T>();
179 this.listen( 179 this.listen(
180 sink.add, 180 sink.add,
181 onError: onError, 181 onError: onError,
182 onDone: () { 182 onDone: () {
183 sink.close(); 183 sink.close();
184 result.setValue(null); 184 result._setValue(null);
185 }, 185 },
186 unsubscribeOnError: unsubscribeOnError); 186 unsubscribeOnError: unsubscribeOnError);
187 return result; 187 return result;
188 } 188 }
189 189
190 190
191 /** 191 /**
192 * Check whether [match] occurs in the elements provided by this stream. 192 * Check whether [match] occurs in the elements provided by this stream.
193 * 193 *
194 * Completes the [Future] when the answer is known. 194 * Completes the [Future] when the answer is known.
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 sink.signalError(error); 852 sink.signalError(error);
853 } 853 }
854 854
855 /** 855 /**
856 * Handle an incoming done event. 856 * Handle an incoming done event.
857 */ 857 */
858 void handleDone(StreamSink<T> sink) { 858 void handleDone(StreamSink<T> sink) {
859 sink.close(); 859 sink.close();
860 } 860 }
861 } 861 }
OLDNEW
« no previous file with comments | « sdk/lib/async/future_impl.dart ('k') | sdk/lib/async/stream_controller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698