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

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

Issue 12380015: Fix for issue 8311. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test. Created 7 years, 9 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 | tests/lib/async/stream_transform_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
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 1071
1072 void _handleError(AsyncError error) { 1072 void _handleError(AsyncError error) {
1073 try { 1073 try {
1074 _transformer.handleError(error, _sink); 1074 _transformer.handleError(error, _sink);
1075 } catch (e, s) { 1075 } catch (e, s) {
1076 _sendError(_asyncError(e, s, error)); 1076 _sendError(_asyncError(e, s, error));
1077 } 1077 }
1078 } 1078 }
1079 1079
1080 void _handleDone() { 1080 void _handleDone() {
1081 _subscription = null;
1081 try { 1082 try {
1082 _transformer.handleDone(_sink); 1083 _transformer.handleDone(_sink);
1083 } catch (e, s) { 1084 } catch (e, s) {
1084 _sendError(_asyncError(e, s)); 1085 _sendError(_asyncError(e, s));
1085 } 1086 }
1086 } 1087 }
1087 1088
1088 // StreamOutputSink interface. 1089 // StreamOutputSink interface.
1089 void _sendData(T data) { 1090 void _sendData(T data) {
1090 _onData(data); 1091 _onData(data);
(...skipping 14 matching lines...) Expand all
1105 } 1106 }
1106 1107
1107 class _StreamOutputSinkWrapper<T> implements StreamSink<T> { 1108 class _StreamOutputSinkWrapper<T> implements StreamSink<T> {
1108 _StreamOutputSink _sink; 1109 _StreamOutputSink _sink;
1109 _StreamOutputSinkWrapper(this._sink); 1110 _StreamOutputSinkWrapper(this._sink);
1110 1111
1111 void add(T data) => _sink._sendData(data); 1112 void add(T data) => _sink._sendData(data);
1112 void signalError(AsyncError error) => _sink._sendError(error); 1113 void signalError(AsyncError error) => _sink._sendError(error);
1113 void close() => _sink._sendDone(); 1114 void close() => _sink._sendDone();
1114 } 1115 }
OLDNEW
« no previous file with comments | « no previous file | tests/lib/async/stream_transform_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698