| OLD | NEW |
| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // If the transformation sends a done signal, we stop the subscription. | 164 // If the transformation sends a done signal, we stop the subscription. |
| 165 if (_subscription != null) { | 165 if (_subscription != null) { |
| 166 _subscription.cancel(); | 166 _subscription.cancel(); |
| 167 _subscription = null; | 167 _subscription = null; |
| 168 } | 168 } |
| 169 _onDone(); | 169 _onDone(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 // Methods used as listener on source subscription. | 172 // Methods used as listener on source subscription. |
| 173 | 173 |
| 174 void _handleData(S data) { | 174 // TODO(ahe): Restore type when feature is implemented in dart2js |
| 175 // checked mode. http://dartbug.com/7733 |
| 176 void _handleData(/*S*/ data) { |
| 175 _stream._handleData(data, this); | 177 _stream._handleData(data, this); |
| 176 } | 178 } |
| 177 | 179 |
| 178 void _handleError(AsyncError error) { | 180 void _handleError(AsyncError error) { |
| 179 _stream._handleError(error, this); | 181 _stream._handleError(error, this); |
| 180 } | 182 } |
| 181 | 183 |
| 182 void _handleDone() { | 184 void _handleDone() { |
| 183 _stream._handleDone(this); | 185 _stream._handleDone(this); |
| 184 } | 186 } |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 /** Creates a [StreamSink] from a [_StreamImpl]'s input methods. */ | 504 /** Creates a [StreamSink] from a [_StreamImpl]'s input methods. */ |
| 503 class _StreamImplSink<T> implements StreamSink<T> { | 505 class _StreamImplSink<T> implements StreamSink<T> { |
| 504 _StreamImpl<T> _target; | 506 _StreamImpl<T> _target; |
| 505 _StreamImplSink(this._target); | 507 _StreamImplSink(this._target); |
| 506 void add(T data) { _target._add(data); } | 508 void add(T data) { _target._add(data); } |
| 507 void signalError(AsyncError error) { _target._signalError(error); } | 509 void signalError(AsyncError error) { _target._signalError(error); } |
| 508 void close() { _target._close(); } | 510 void close() { _target._close(); } |
| 509 } | 511 } |
| 510 | 512 |
| 511 | 513 |
| OLD | NEW |