| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |