| OLD | NEW |
| 1 part of dart.async; | 1 part of dart.async; |
| 2 _runUserCode(userCode(), onSuccess(value), onError(error, StackTrace stackTrace
)) { | 2 _runUserCode(userCode(), onSuccess(value), onError(error, StackTrace stackTrace
)) { |
| 3 try { | 3 try { |
| 4 onSuccess(userCode()); | 4 onSuccess(userCode()); |
| 5 } | 5 } |
| 6 catch (e, s) { | 6 catch (e, s) { |
| 7 AsyncError replacement = Zone.current.errorCallback(e, s); | 7 AsyncError replacement = Zone.current.errorCallback(e, s); |
| 8 if (replacement == null) { | 8 if (replacement == null) { |
| 9 onError(e, s); | 9 onError(e, s); |
| 10 } | 10 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 StreamSubscription<T> listen(void onData(T value), { | 48 StreamSubscription<T> listen(void onData(T value), { |
| 49 Function onError, void onDone(), bool cancelOnError} | 49 Function onError, void onDone(), bool cancelOnError} |
| 50 ) { | 50 ) { |
| 51 cancelOnError = identical(true, cancelOnError); | 51 cancelOnError = identical(true, cancelOnError); |
| 52 return _createSubscription(onData, onError, onDone, cancelOnError); | 52 return _createSubscription(onData, onError, onDone, cancelOnError); |
| 53 } | 53 } |
| 54 StreamSubscription<T> _createSubscription(void onData(T data), Function onError
, void onDone(), bool cancelOnError) { | 54 StreamSubscription<T> _createSubscription(void onData(T data), Function onError
, void onDone(), bool cancelOnError) { |
| 55 return new _ForwardingStreamSubscription<S, T>(this, onData, onError, onDone,
cancelOnError); | 55 return new _ForwardingStreamSubscription<S, T>(this, onData, onError, onDone,
cancelOnError); |
| 56 } | 56 } |
| 57 void _handleData(S data, _EventSink<T> sink) { | 57 void _handleData(S data, _EventSink<T> sink) { |
| 58 var outputData = data; | 58 dynamic outputData = data; |
| 59 sink._add(outputData); | 59 sink._add(DEVC$RT.cast(outputData, dynamic, T, "CompositeCast", """line 104,
column 15 of dart:async/stream_pipe.dart: """, outputData is T, false)); |
| 60 } | 60 } |
| 61 void _handleError(error, StackTrace stackTrace, _EventSink<T> sink) { | 61 void _handleError(error, StackTrace stackTrace, _EventSink<T> sink) { |
| 62 sink._addError(error, stackTrace); | 62 sink._addError(error, stackTrace); |
| 63 } | 63 } |
| 64 void _handleDone(_EventSink<T> sink) { | 64 void _handleDone(_EventSink<T> sink) { |
| 65 sink._close(); | 65 sink._close(); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 class _ForwardingStreamSubscription<S, T> extends _BufferingStreamSubscription<
T> {final _ForwardingStream<S, T> _stream; | 68 class _ForwardingStreamSubscription<S, T> extends _BufferingStreamSubscription<
T> {final _ForwardingStream<S, T> _stream; |
| 69 StreamSubscription<S> _subscription; | 69 StreamSubscription<S> _subscription; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 sink._add(inputEvent); | 123 sink._add(inputEvent); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 typedef T _Transformation<S, T>(S value); | 127 typedef T _Transformation<S, T>(S value); |
| 128 class _MapStream<S, T> extends _ForwardingStream<S, T> {final _Transformation _
transform; | 128 class _MapStream<S, T> extends _ForwardingStream<S, T> {final _Transformation _
transform; |
| 129 _MapStream(Stream<S> source, T transform(S event)) : this._transform = transfor
m, super(source); | 129 _MapStream(Stream<S> source, T transform(S event)) : this._transform = transfor
m, super(source); |
| 130 void _handleData(S inputEvent, _EventSink<T> sink) { | 130 void _handleData(S inputEvent, _EventSink<T> sink) { |
| 131 T outputEvent; | 131 T outputEvent; |
| 132 try { | 132 try { |
| 133 outputEvent = ((__x61) => DEVC$RT.cast(__x61, dynamic, T, "CompositeCast", """li
ne 235, column 21 of dart:async/stream_pipe.dart: """, __x61 is T, false))(_tran
sform(inputEvent)); | 133 outputEvent = ((__x63) => DEVC$RT.cast(__x63, dynamic, T, "CompositeCast", """li
ne 235, column 21 of dart:async/stream_pipe.dart: """, __x63 is T, false))(_tran
sform(inputEvent)); |
| 134 } | 134 } |
| 135 catch (e, s) { | 135 catch (e, s) { |
| 136 _addErrorWithReplacement(sink, e, s); | 136 _addErrorWithReplacement(sink, e, s); |
| 137 return;} | 137 return;} |
| 138 sink._add(outputEvent); | 138 sink._add(outputEvent); |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 class _ExpandStream<S, T> extends _ForwardingStream<S, T> {final _Transformatio
n<S, Iterable<T>> _expand; | 141 class _ExpandStream<S, T> extends _ForwardingStream<S, T> {final _Transformatio
n<S, Iterable<T>> _expand; |
| 142 _ExpandStream(Stream<S> source, Iterable<T> expand(S event)) : this._expand = e
xpand, super(source); | 142 _ExpandStream(Stream<S> source, Iterable<T> expand(S event)) : this._expand = e
xpand, super(source); |
| 143 void _handleData(S inputEvent, _EventSink<T> sink) { | 143 void _handleData(S inputEvent, _EventSink<T> sink) { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 _addErrorWithReplacement(sink, e, s); | 272 _addErrorWithReplacement(sink, e, s); |
| 273 return null; | 273 return null; |
| 274 } | 274 } |
| 275 if (!isEqual) { | 275 if (!isEqual) { |
| 276 sink._add(inputEvent); | 276 sink._add(inputEvent); |
| 277 _previous = inputEvent; | 277 _previous = inputEvent; |
| 278 } | 278 } |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 } | 281 } |
| OLD | NEW |