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

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

Issue 12213009: Fix bad handling of done events in _ForwardingStream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More tests Created 7 years, 10 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
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 /** Utility function to create an [AsyncError] if [error] isn't one already. */ 7 /** Utility function to create an [AsyncError] if [error] isn't one already. */
8 AsyncError _asyncError(Object error, Object stackTrace, [AsyncError cause]) { 8 AsyncError _asyncError(Object error, Object stackTrace, [AsyncError cause]) {
9 if (error is AsyncError) return error; 9 if (error is AsyncError) return error;
10 if (cause == null) return new AsyncError(error, stackTrace); 10 if (cause == null) return new AsyncError(error, stackTrace);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // checked mode. http://dartbug.com/7733 208 // checked mode. http://dartbug.com/7733
209 void _handleData(/*S*/ data) { 209 void _handleData(/*S*/ data) {
210 _stream._handleData(data, this); 210 _stream._handleData(data, this);
211 } 211 }
212 212
213 void _handleError(AsyncError error) { 213 void _handleError(AsyncError error) {
214 _stream._handleError(error, this); 214 _stream._handleError(error, this);
215 } 215 }
216 216
217 void _handleDone() { 217 void _handleDone() {
218 // On a done-event, we have already been unsubscribed.
219 _subscription = null;
218 _stream._handleDone(this); 220 _stream._handleDone(this);
219 } 221 }
220 } 222 }
221 223
222 // ------------------------------------------------------------------- 224 // -------------------------------------------------------------------
223 // Stream transformers used by the default Stream implementation. 225 // Stream transformers used by the default Stream implementation.
224 // ------------------------------------------------------------------- 226 // -------------------------------------------------------------------
225 227
226 typedef bool _Predicate<T>(T value); 228 typedef bool _Predicate<T>(T value);
227 229
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 527
526 void handleError(AsyncError error, StreamSink<T> sink) { 528 void handleError(AsyncError error, StreamSink<T> sink) {
527 _handleError(error, sink); 529 _handleError(error, sink);
528 } 530 }
529 531
530 void handleDone(StreamSink<T> sink) { 532 void handleDone(StreamSink<T> sink) {
531 _handleDone(sink); 533 _handleDone(sink);
532 } 534 }
533 } 535 }
534 536
OLDNEW
« no previous file with comments | « no previous file | tests/lib/async/stream_transform_test.dart » ('j') | tests/lib/async/stream_transform_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698