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

Side by Side Diff: test/dart_codegen/expect/async/stream_impl.dart

Issue 1038213003: Downward inference (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Implement named arguments, some fixes Created 5 years, 8 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
OLDNEW
1 part of dart.async; 1 part of dart.async;
2 abstract class _EventSink<T> {void _add(T data); 2 abstract class _EventSink<T> {void _add(T data);
3 void _addError(Object error, StackTrace stackTrace); 3 void _addError(Object error, StackTrace stackTrace);
4 void _close(); 4 void _close();
5 } 5 }
6 abstract class _EventDispatch<T> {void _sendData(T data); 6 abstract class _EventDispatch<T> {void _sendData(T data);
7 void _sendError(Object error, StackTrace stackTrace); 7 void _sendError(Object error, StackTrace stackTrace);
8 void _sendDone(); 8 void _sendDone();
9 } 9 }
10 class _BufferingStreamSubscription<T> implements StreamSubscription<T>, _EventS ink<T>, _EventDispatch<T> {static const int _STATE_CANCEL_ON_ERROR = 1; 10 class _BufferingStreamSubscription<T> implements StreamSubscription<T>, _EventS ink<T>, _EventDispatch<T> {static const int _STATE_CANCEL_ON_ERROR = 1;
(...skipping 23 matching lines...) Expand all
34 _state |= _STATE_HAS_PENDING; 34 _state |= _STATE_HAS_PENDING;
35 _pending.schedule(this); 35 _pending.schedule(this);
36 } 36 }
37 } 37 }
38 _PendingEvents _extractPending() { 38 _PendingEvents _extractPending() {
39 assert (_isCanceled); _PendingEvents events = _pending; 39 assert (_isCanceled); _PendingEvents events = _pending;
40 _pending = null; 40 _pending = null;
41 return events; 41 return events;
42 } 42 }
43 void onData(void handleData(T event)) { 43 void onData(void handleData(T event)) {
44 if (handleData == null) handleData = DEVC$RT.wrap((void f(dynamic __u86)) { 44 if (handleData == null) handleData = DEVC$RT.wrap((void f(dynamic __u77)) {
45 void c(dynamic x0) => f(x0); 45 void c(dynamic x0) => f(x0);
46 return f == null ? null : c; 46 return f == null ? null : c;
47 } 47 }
48 , _nullDataHandler, __t89, DEVC$RT.type((__t87<T> _) { 48 , _nullDataHandler, __t80, DEVC$RT.type((__t78<T> _) {
49 } 49 }
50 ), "Wrap", """line 153, column 42 of dart:async/stream_impl.dart: """, _nullData Handler is __t87<T>); 50 ), "Wrap", """line 153, column 42 of dart:async/stream_impl.dart: """, _nullData Handler is __t78<T>);
51 _onData = ((__x94) => DEVC$RT.wrap((dynamic f(dynamic __u91)) { 51 _onData = ((__x85) => DEVC$RT.wrap((dynamic f(dynamic __u82)) {
52 dynamic c(dynamic x0) => f(x0); 52 dynamic c(dynamic x0) => f(x0);
53 return f == null ? null : c; 53 return f == null ? null : c;
54 } 54 }
55 , __x94, __t92, DEVC$RT.type((__t87<T> _) { 55 , __x85, __t83, DEVC$RT.type((__t78<T> _) {
56 } 56 }
57 ), "Wrap", """line 154, column 15 of dart:async/stream_impl.dart: """, __x94 is __t87<T>))(_zone.registerUnaryCallback(handleData)); 57 ), "Wrap", """line 154, column 15 of dart:async/stream_impl.dart: """, __x85 is __t78<T>))(_zone.registerUnaryCallback(handleData));
58 } 58 }
59 void onError(Function handleError) { 59 void onError(Function handleError) {
60 if (handleError == null) handleError = _nullErrorHandler; 60 if (handleError == null) handleError = _nullErrorHandler;
61 _onError = _registerErrorHandler(handleError, _zone); 61 _onError = _registerErrorHandler(handleError, _zone);
62 } 62 }
63 void onDone(void handleDone()) { 63 void onDone(void handleDone()) {
64 if (handleDone == null) handleDone = _nullDoneHandler; 64 if (handleDone == null) handleDone = _nullDoneHandler;
65 _onDone = _zone.registerCallback(handleDone); 65 _onDone = _zone.registerCallback(handleDone);
66 } 66 }
67 void pause([Future resumeSignal]) { 67 void pause([Future resumeSignal]) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 _state |= _STATE_IN_CALLBACK; 178 _state |= _STATE_IN_CALLBACK;
179 _zone.runUnaryGuarded(_onData, data); 179 _zone.runUnaryGuarded(_onData, data);
180 _state &= ~_STATE_IN_CALLBACK; 180 _state &= ~_STATE_IN_CALLBACK;
181 _checkState(wasInputPaused); 181 _checkState(wasInputPaused);
182 } 182 }
183 void _sendError(var error, StackTrace stackTrace) { 183 void _sendError(var error, StackTrace stackTrace) {
184 assert (!_isCanceled); assert (!_isPaused); assert (!_inCallback); bool wasInput Paused = _isInputPaused; 184 assert (!_isCanceled); assert (!_isPaused); assert (!_inCallback); bool wasInput Paused = _isInputPaused;
185 void sendError() { 185 void sendError() {
186 if (_isCanceled && !_waitsForCancel) return; _state |= _STATE_IN_CALLBACK; 186 if (_isCanceled && !_waitsForCancel) return; _state |= _STATE_IN_CALLBACK;
187 if (_onError is ZoneBinaryCallback) { 187 if (_onError is ZoneBinaryCallback) {
188 _zone.runBinaryGuarded(DEVC$RT.cast(_onError, Function, __t95, "ImplicitCast", """line 358, column 32 of dart:async/stream_impl.dart: """, _onError is __t95, true), error, stackTrace); 188 _zone.runBinaryGuarded(DEVC$RT.cast(_onError, Function, __t86, "ImplicitCast", """line 358, column 32 of dart:async/stream_impl.dart: """, _onError is __t86, true), error, stackTrace);
189 } 189 }
190 else { 190 else {
191 _zone.runUnaryGuarded(DEVC$RT.cast(_onError, Function, __t92, "ImplicitCast", """line 360, column 31 of dart:async/stream_impl.dart: """, _onError is __t92, t rue), error); 191 _zone.runUnaryGuarded(DEVC$RT.cast(_onError, Function, __t83, "ImplicitCast", """line 360, column 31 of dart:async/stream_impl.dart: """, _onError is __t83, t rue), error);
192 } 192 }
193 _state &= ~_STATE_IN_CALLBACK; 193 _state &= ~_STATE_IN_CALLBACK;
194 } 194 }
195 if (_cancelOnError) { 195 if (_cancelOnError) {
196 _state |= _STATE_WAIT_FOR_CANCEL; 196 _state |= _STATE_WAIT_FOR_CANCEL;
197 _cancel(); 197 _cancel();
198 if (_cancelFuture is Future) { 198 if (_cancelFuture is Future) {
199 _cancelFuture.whenComplete(sendError); 199 _cancelFuture.whenComplete(sendError);
200 } 200 }
201 else { 201 else {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 if (isPaused) return; _state |= _DONE_SENT; 461 if (isPaused) return; _state |= _DONE_SENT;
462 if (_onDone != null) _zone.runGuarded(_onDone); 462 if (_onDone != null) _zone.runGuarded(_onDone);
463 } 463 }
464 } 464 }
465 class _AsBroadcastStream<T> extends Stream<T> {final Stream<T> _source; 465 class _AsBroadcastStream<T> extends Stream<T> {final Stream<T> _source;
466 final _broadcastCallback _onListenHandler; 466 final _broadcastCallback _onListenHandler;
467 final _broadcastCallback _onCancelHandler; 467 final _broadcastCallback _onCancelHandler;
468 final Zone _zone; 468 final Zone _zone;
469 _AsBroadcastStreamController<T> _controller; 469 _AsBroadcastStreamController<T> _controller;
470 StreamSubscription<T> _subscription; 470 StreamSubscription<T> _subscription;
471 _AsBroadcastStream(this._source, void onListenHandler(StreamSubscription subscr iption), void onCancelHandler(StreamSubscription subscription)) : _onListenHandl er = ((__x101) => DEVC$RT.wrap((dynamic f(dynamic __u98)) { 471 _AsBroadcastStream(this._source, void onListenHandler(StreamSubscription subscr iption), void onCancelHandler(StreamSubscription subscription)) : _onListenHandl er = ((__x92) => DEVC$RT.wrap((dynamic f(dynamic __u89)) {
472 dynamic c(dynamic x0) => f(x0); 472 dynamic c(dynamic x0) => f(x0);
473 return f == null ? null : c; 473 return f == null ? null : c;
474 } 474 }
475 , __x101, __t92, __t99, "Wrap", """line 813, column 28 of dart:async/stream_impl .dart: """, __x101 is __t99))(Zone.current.registerUnaryCallback(onListenHandler )), _onCancelHandler = ((__x103) => DEVC$RT.wrap((dynamic f(dynamic __u102)) { 475 , __x92, __t83, __t90, "Wrap", """line 813, column 28 of dart:async/stream_impl. dart: """, __x92 is __t90))(Zone.current.registerUnaryCallback(onListenHandler)) , _onCancelHandler = ((__x94) => DEVC$RT.wrap((dynamic f(dynamic __u93)) {
476 dynamic c(dynamic x0) => f(x0); 476 dynamic c(dynamic x0) => f(x0);
477 return f == null ? null : c; 477 return f == null ? null : c;
478 } 478 }
479 , __x103, __t92, __t99, "Wrap", """line 814, column 28 of dart:async/stream_impl .dart: """, __x103 is __t99))(Zone.current.registerUnaryCallback(onCancelHandler )), _zone = Zone.current { 479 , __x94, __t83, __t90, "Wrap", """line 814, column 28 of dart:async/stream_impl. dart: """, __x94 is __t90))(Zone.current.registerUnaryCallback(onCancelHandler)) , _zone = Zone.current {
480 _controller = new _AsBroadcastStreamController<T>(_onListen, _onCancel); 480 _controller = new _AsBroadcastStreamController<T>(_onListen, _onCancel);
481 } 481 }
482 bool get isBroadcast => true; 482 bool get isBroadcast => true;
483 StreamSubscription<T> listen(void onData(T data), { 483 StreamSubscription<T> listen(void onData(T data), {
484 Function onError, void onDone(), bool cancelOnError} 484 Function onError, void onDone(), bool cancelOnError}
485 ) { 485 ) {
486 if (_controller == null || _controller.isClosed) { 486 if (_controller == null || _controller.isClosed) {
487 return new _DoneStreamSubscription<T>(onDone); 487 return new _DoneStreamSubscription<T>(onDone);
488 } 488 }
489 if (_subscription == null) { 489 if (_subscription == null) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 } 649 }
650 ), "CompositeCast", """line 1073, column 31 of dart:async/stream_impl.dart: """, _futureOrPrefetch is _Future<bool>, false); 650 ), "CompositeCast", """line 1073, column 31 of dart:async/stream_impl.dart: """, _futureOrPrefetch is _Future<bool>, false);
651 _clear(); 651 _clear();
652 hasNext._complete(false); 652 hasNext._complete(false);
653 return;} 653 return;}
654 _subscription.pause(); 654 _subscription.pause();
655 _futureOrPrefetch = null; 655 _futureOrPrefetch = null;
656 _state = _STATE_EXTRA_DONE; 656 _state = _STATE_EXTRA_DONE;
657 } 657 }
658 } 658 }
659 typedef void __t87<T>(T __u88); 659 typedef void __t78<T>(T __u79);
660 typedef void __t89(dynamic __u90); 660 typedef void __t80(dynamic __u81);
661 typedef dynamic __t92(dynamic __u93); 661 typedef dynamic __t83(dynamic __u84);
662 typedef dynamic __t95(dynamic __u96, dynamic __u97); 662 typedef dynamic __t86(dynamic __u87, dynamic __u88);
663 typedef void __t99(StreamSubscription<dynamic> __u100); 663 typedef void __t90(StreamSubscription<dynamic> __u91);
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/async/stream_controller.dart ('k') | test/dart_codegen/expect/async/stream_pipe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698