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

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

Issue 1052383003: Disable closure wrapping by default (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: 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 __u74)) { 44 if (handleData == null) handleData = DEVC$RT.cast(_nullDataHandler, __t64, DEVC$ RT.type((__t62<T> _) {
45 void c(dynamic x0) => f(x0);
46 return f == null ? null : c;
47 } 45 }
48 , _nullDataHandler, __t77, DEVC$RT.type((__t75<T> _) { 46 ), "CompositeCast", """line 153, column 42 of dart:async/stream_impl.dart: """, _nullDataHandler is __t62<T>, false);
47 _onData = ((__x68) => DEVC$RT.cast(__x68, __t66, DEVC$RT.type((__t62<T> _) {
49 } 48 }
50 ), "Wrap", """line 153, column 42 of dart:async/stream_impl.dart: """, _nullData Handler is __t75<T>); 49 ), "CompositeCast", """line 154, column 15 of dart:async/stream_impl.dart: """, __x68 is __t62<T>, false))(_zone.registerUnaryCallback(handleData));
51 _onData = ((__x82) => DEVC$RT.wrap((dynamic f(dynamic __u79)) {
52 dynamic c(dynamic x0) => f(x0);
53 return f == null ? null : c;
54 }
55 , __x82, __t80, DEVC$RT.type((__t75<T> _) {
56 }
57 ), "Wrap", """line 154, column 15 of dart:async/stream_impl.dart: """, __x82 is __t75<T>))(_zone.registerUnaryCallback(handleData));
58 } 50 }
59 void onError(Function handleError) { 51 void onError(Function handleError) {
60 if (handleError == null) handleError = _nullErrorHandler; 52 if (handleError == null) handleError = _nullErrorHandler;
61 _onError = _registerErrorHandler(handleError, _zone); 53 _onError = _registerErrorHandler(handleError, _zone);
62 } 54 }
63 void onDone(void handleDone()) { 55 void onDone(void handleDone()) {
64 if (handleDone == null) handleDone = _nullDoneHandler; 56 if (handleDone == null) handleDone = _nullDoneHandler;
65 _onDone = _zone.registerCallback(handleDone); 57 _onDone = _zone.registerCallback(handleDone);
66 } 58 }
67 void pause([Future resumeSignal]) { 59 void pause([Future resumeSignal]) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 _state |= _STATE_IN_CALLBACK; 170 _state |= _STATE_IN_CALLBACK;
179 _zone.runUnaryGuarded(_onData, data); 171 _zone.runUnaryGuarded(_onData, data);
180 _state &= ~_STATE_IN_CALLBACK; 172 _state &= ~_STATE_IN_CALLBACK;
181 _checkState(wasInputPaused); 173 _checkState(wasInputPaused);
182 } 174 }
183 void _sendError(var error, StackTrace stackTrace) { 175 void _sendError(var error, StackTrace stackTrace) {
184 assert (!_isCanceled); assert (!_isPaused); assert (!_inCallback); bool wasInput Paused = _isInputPaused; 176 assert (!_isCanceled); assert (!_isPaused); assert (!_inCallback); bool wasInput Paused = _isInputPaused;
185 void sendError() { 177 void sendError() {
186 if (_isCanceled && !_waitsForCancel) return; _state |= _STATE_IN_CALLBACK; 178 if (_isCanceled && !_waitsForCancel) return; _state |= _STATE_IN_CALLBACK;
187 if (_onError is ZoneBinaryCallback) { 179 if (_onError is ZoneBinaryCallback) {
188 _zone.runBinaryGuarded(DEVC$RT.cast(_onError, Function, __t83, "ImplicitCast", """line 358, column 32 of dart:async/stream_impl.dart: """, _onError is __t83, true), error, stackTrace); 180 _zone.runBinaryGuarded(DEVC$RT.cast(_onError, Function, __t69, "ImplicitCast", """line 358, column 32 of dart:async/stream_impl.dart: """, _onError is __t69, true), error, stackTrace);
189 } 181 }
190 else { 182 else {
191 _zone.runUnaryGuarded(DEVC$RT.cast(_onError, Function, __t80, "ImplicitCast", """line 360, column 31 of dart:async/stream_impl.dart: """, _onError is __t80, t rue), error); 183 _zone.runUnaryGuarded(DEVC$RT.cast(_onError, Function, __t66, "ImplicitCast", """line 360, column 31 of dart:async/stream_impl.dart: """, _onError is __t66, t rue), error);
192 } 184 }
193 _state &= ~_STATE_IN_CALLBACK; 185 _state &= ~_STATE_IN_CALLBACK;
194 } 186 }
195 if (_cancelOnError) { 187 if (_cancelOnError) {
196 _state |= _STATE_WAIT_FOR_CANCEL; 188 _state |= _STATE_WAIT_FOR_CANCEL;
197 _cancel(); 189 _cancel();
198 if (_cancelFuture is Future) { 190 if (_cancelFuture is Future) {
199 _cancelFuture.whenComplete(sendError); 191 _cancelFuture.whenComplete(sendError);
200 } 192 }
201 else { 193 else {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 if (isPaused) return; _state |= _DONE_SENT; 453 if (isPaused) return; _state |= _DONE_SENT;
462 if (_onDone != null) _zone.runGuarded(_onDone); 454 if (_onDone != null) _zone.runGuarded(_onDone);
463 } 455 }
464 } 456 }
465 class _AsBroadcastStream<T> extends Stream<T> {final Stream<T> _source; 457 class _AsBroadcastStream<T> extends Stream<T> {final Stream<T> _source;
466 final _broadcastCallback _onListenHandler; 458 final _broadcastCallback _onListenHandler;
467 final _broadcastCallback _onCancelHandler; 459 final _broadcastCallback _onCancelHandler;
468 final Zone _zone; 460 final Zone _zone;
469 _AsBroadcastStreamController<T> _controller; 461 _AsBroadcastStreamController<T> _controller;
470 StreamSubscription<T> _subscription; 462 StreamSubscription<T> _subscription;
471 _AsBroadcastStream(this._source, void onListenHandler(StreamSubscription subscr iption), void onCancelHandler(StreamSubscription subscription)) : _onListenHandl er = ((__x89) => DEVC$RT.wrap((dynamic f(dynamic __u86)) { 463 _AsBroadcastStream(this._source, void onListenHandler(StreamSubscription subscr iption), void onCancelHandler(StreamSubscription subscription)) : _onListenHandl er = ((__x74) => DEVC$RT.cast(__x74, __t66, __t72, "CompositeCast", """line 813, column 28 of dart:async/stream_impl.dart: """, __x74 is __t72, false))(Zone.cur rent.registerUnaryCallback(onListenHandler)), _onCancelHandler = ((__x75) => DEV C$RT.cast(__x75, __t66, __t72, "CompositeCast", """line 814, column 28 of dart:a sync/stream_impl.dart: """, __x75 is __t72, false))(Zone.current.registerUnaryCa llback(onCancelHandler)), _zone = Zone.current {
472 dynamic c(dynamic x0) => f(x0);
473 return f == null ? null : c;
474 }
475 , __x89, __t80, __t87, "Wrap", """line 813, column 28 of dart:async/stream_impl. dart: """, __x89 is __t87))(Zone.current.registerUnaryCallback(onListenHandler)) , _onCancelHandler = ((__x91) => DEVC$RT.wrap((dynamic f(dynamic __u90)) {
476 dynamic c(dynamic x0) => f(x0);
477 return f == null ? null : c;
478 }
479 , __x91, __t80, __t87, "Wrap", """line 814, column 28 of dart:async/stream_impl. dart: """, __x91 is __t87))(Zone.current.registerUnaryCallback(onCancelHandler)) , _zone = Zone.current {
480 _controller = new _AsBroadcastStreamController<T>(_onListen, _onCancel); 464 _controller = new _AsBroadcastStreamController<T>(_onListen, _onCancel);
481 } 465 }
482 bool get isBroadcast => true; 466 bool get isBroadcast => true;
483 StreamSubscription<T> listen(void onData(T data), { 467 StreamSubscription<T> listen(void onData(T data), {
484 Function onError, void onDone(), bool cancelOnError} 468 Function onError, void onDone(), bool cancelOnError}
485 ) { 469 ) {
486 if (_controller == null || _controller.isClosed) { 470 if (_controller == null || _controller.isClosed) {
487 return new _DoneStreamSubscription<T>(onDone); 471 return new _DoneStreamSubscription<T>(onDone);
488 } 472 }
489 if (_subscription == null) { 473 if (_subscription == null) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 } 633 }
650 ), "CompositeCast", """line 1073, column 31 of dart:async/stream_impl.dart: """, _futureOrPrefetch is _Future<bool>, false); 634 ), "CompositeCast", """line 1073, column 31 of dart:async/stream_impl.dart: """, _futureOrPrefetch is _Future<bool>, false);
651 _clear(); 635 _clear();
652 hasNext._complete(false); 636 hasNext._complete(false);
653 return;} 637 return;}
654 _subscription.pause(); 638 _subscription.pause();
655 _futureOrPrefetch = null; 639 _futureOrPrefetch = null;
656 _state = _STATE_EXTRA_DONE; 640 _state = _STATE_EXTRA_DONE;
657 } 641 }
658 } 642 }
659 typedef void __t75<T>(T __u76); 643 typedef void __t62<T>(T __u63);
660 typedef void __t77(dynamic __u78); 644 typedef void __t64(dynamic __u65);
661 typedef dynamic __t80(dynamic __u81); 645 typedef dynamic __t66(dynamic __u67);
662 typedef dynamic __t83(dynamic __u84, dynamic __u85); 646 typedef dynamic __t69(dynamic __u70, dynamic __u71);
663 typedef void __t87(StreamSubscription<dynamic> __u88); 647 typedef void __t72(StreamSubscription<dynamic> __u73);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698