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

Side by Side Diff: lib/runtime/dart/async.js

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 var async; 1 var async;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 // Function _invokeErrorHandler: (Function, Object, StackTrace) → dynamic 4 // Function _invokeErrorHandler: (Function, Object, StackTrace) → dynamic
5 function _invokeErrorHandler(errorHandler, error, stackTrace) { 5 function _invokeErrorHandler(errorHandler, error, stackTrace) {
6 if (dart.is(errorHandler, ZoneBinaryCallback)) { 6 if (dart.is(errorHandler, ZoneBinaryCallback)) {
7 return dart.dinvokef(errorHandler, error, stackTrace); 7 return dart.dinvokef(errorHandler, error, stackTrace);
8 } else { 8 } else {
9 return dart.dinvokef(errorHandler, error); 9 return dart.dinvokef(errorHandler, error);
10 } 10 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 let _addError = Symbol('_addError'); 54 let _addError = Symbol('_addError');
55 let _completeError = Symbol('_completeError'); 55 let _completeError = Symbol('_completeError');
56 let _complete = Symbol('_complete'); 56 let _complete = Symbol('_complete');
57 let _sink = Symbol('_sink'); 57 let _sink = Symbol('_sink');
58 let Stream$ = dart.generic(function(T) { 58 let Stream$ = dart.generic(function(T) {
59 class Stream extends core.Object { 59 class Stream extends core.Object {
60 Stream() { 60 Stream() {
61 } 61 }
62 fromFuture(future) { 62 fromFuture(future) {
63 let controller = new (StreamController$(T))({sync: true}); 63 let controller = new (StreamController$(T))({sync: true});
64 future.then(dart.closureWrap((value) => { 64 future.then(dart.as((value) => {
65 controller._add(dart.as(value, T)); 65 controller._add(dart.as(value, T));
66 controller._closeUnchecked(); 66 controller._closeUnchecked();
67 }, "(T) → dynamic"), { 67 }, dart.throw_("Unimplemented type (T) → dynamic")), {
68 onError: (error, stackTrace) => { 68 onError: (error, stackTrace) => {
69 controller._addError(error, dart.as(stackTrace, core.StackTrace)); 69 controller._addError(error, dart.as(stackTrace, core.StackTrace));
70 controller._closeUnchecked(); 70 controller._closeUnchecked();
71 } 71 }
72 }); 72 });
73 return controller.stream; 73 return controller.stream;
74 } 74 }
75 fromIterable(data) { 75 fromIterable(data) {
76 return new (_GeneratedStreamImpl$(T))(() => new (_IterablePendingEvents$ (T))(data)); 76 return new (_GeneratedStreamImpl$(T))(() => new (_IterablePendingEvents$ (T))(data));
77 } 77 }
78 periodic(period, computation) { 78 periodic(period, computation) {
79 if (computation === void 0) 79 if (computation === void 0)
80 computation = null; 80 computation = null;
81 if (computation == null) 81 if (computation == null)
82 computation = dart.closureWrap((i) => null, "(int) → T"); 82 computation = dart.as((i) => null, dart.throw_("Unimplemented type (in t) → T"));
83 let timer = null; 83 let timer = null;
84 let computationCount = 0; 84 let computationCount = 0;
85 let controller = null; 85 let controller = null;
86 let watch = new core.Stopwatch(); 86 let watch = new core.Stopwatch();
87 // Function sendEvent: () → void 87 // Function sendEvent: () → void
88 function sendEvent() { 88 function sendEvent() {
89 watch.reset(); 89 watch.reset();
90 let data = computation(((x) => computationCount = dart.notNull(x) + 1, x)(computationCount)); 90 let data = computation(((x) => computationCount = dart.notNull(x) + 1, x)(computationCount));
91 controller.add(data); 91 controller.add(data);
92 } 92 }
(...skipping 27 matching lines...) Expand all
120 }, 120 },
121 onCancel: () => { 121 onCancel: () => {
122 if (timer != null) 122 if (timer != null)
123 timer.cancel(); 123 timer.cancel();
124 timer = null; 124 timer = null;
125 } 125 }
126 }); 126 });
127 return controller.stream; 127 return controller.stream;
128 } 128 }
129 eventTransformed(source, mapSink) { 129 eventTransformed(source, mapSink) {
130 return dart.as(new _BoundSinkStream(source, dart.closureWrap(mapSink, "( EventSink<dynamic>) → EventSink")), Stream$(T)); 130 return dart.as(new _BoundSinkStream(source, dart.as(mapSink, _SinkMapper )), Stream$(T));
131 } 131 }
132 get isBroadcast() { 132 get isBroadcast() {
133 return false; 133 return false;
134 } 134 }
135 asBroadcastStream(opts) { 135 asBroadcastStream(opts) {
136 let onListen = opts && 'onListen' in opts ? opts.onListen : null; 136 let onListen = opts && 'onListen' in opts ? opts.onListen : null;
137 let onCancel = opts && 'onCancel' in opts ? opts.onCancel : null; 137 let onCancel = opts && 'onCancel' in opts ? opts.onCancel : null;
138 return new (_AsBroadcastStream$(T))(this, dart.closureWrap(onListen, "(S treamSubscription<dynamic>) → void"), dart.closureWrap(onCancel, "(StreamSubscri ption<dynamic>) → void")); 138 return new (_AsBroadcastStream$(T))(this, dart.as(onListen, dart.throw_( "Unimplemented type (StreamSubscription<dynamic>) → void")), dart.as(onCancel, d art.throw_("Unimplemented type (StreamSubscription<dynamic>) → void")));
139 } 139 }
140 where(test) { 140 where(test) {
141 return new (_WhereStream$(T))(this, test); 141 return new (_WhereStream$(T))(this, test);
142 } 142 }
143 map(convert) { 143 map(convert) {
144 return new (_MapStream$(T, dynamic))(this, convert); 144 return new (_MapStream$(T, dynamic))(this, convert);
145 } 145 }
146 asyncMap(convert) { 146 asyncMap(convert) {
147 let controller = null; 147 let controller = null;
148 let subscription = null; 148 let subscription = null;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 onDone: () => { 403 onDone: () => {
404 future._complete(false); 404 future._complete(false);
405 }, 405 },
406 cancelOnError: true 406 cancelOnError: true
407 }); 407 });
408 return future; 408 return future;
409 } 409 }
410 get length() { 410 get length() {
411 let future = new (_Future$(core.int))(); 411 let future = new (_Future$(core.int))();
412 let count = 0; 412 let count = 0;
413 this.listen(dart.closureWrap((_) => { 413 this.listen(dart.as((_) => {
414 count = dart.notNull(count) + 1; 414 count = dart.notNull(count) + 1;
415 }, "(T) → void"), { 415 }, dart.throw_("Unimplemented type (T) → void")), {
416 onError: future[_completeError], 416 onError: future[_completeError],
417 onDone: () => { 417 onDone: () => {
418 future._complete(count); 418 future._complete(count);
419 }, 419 },
420 cancelOnError: true 420 cancelOnError: true
421 }); 421 });
422 return future; 422 return future;
423 } 423 }
424 get isEmpty() { 424 get isEmpty() {
425 let future = new (_Future$(core.bool))(); 425 let future = new (_Future$(core.bool))();
426 let subscription = null; 426 let subscription = null;
427 subscription = this.listen(dart.closureWrap((_) => { 427 subscription = this.listen(dart.as((_) => {
428 _cancelAndValue(subscription, future, false); 428 _cancelAndValue(subscription, future, false);
429 }, "(T) → void"), { 429 }, dart.throw_("Unimplemented type (T) → void")), {
430 onError: future[_completeError], 430 onError: future[_completeError],
431 onDone: () => { 431 onDone: () => {
432 future._complete(true); 432 future._complete(true);
433 }, 433 },
434 cancelOnError: true 434 cancelOnError: true
435 }); 435 });
436 return future; 436 return future;
437 } 437 }
438 toList() { 438 toList() {
439 let result = new core.List$(T).from([]); 439 let result = new core.List$(T).from([]);
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 controller.close(); 723 controller.close();
724 } 724 }
725 // Function onListen: () → void 725 // Function onListen: () → void
726 function onListen() { 726 function onListen() {
727 zone = Zone.current; 727 zone = Zone.current;
728 if (onTimeout == null) { 728 if (onTimeout == null) {
729 timeout = () => { 729 timeout = () => {
730 controller.addError(new TimeoutException("No stream event", timeLi mit), null); 730 controller.addError(new TimeoutException("No stream event", timeLi mit), null);
731 }; 731 };
732 } else { 732 } else {
733 onTimeout = dart.closureWrap(zone.registerUnaryCallback(onTimeout), "(EventSink<dynamic>) → void"); 733 onTimeout = dart.as(zone.registerUnaryCallback(onTimeout), dart.thro w_("Unimplemented type (EventSink<dynamic>) → void"));
734 let wrapper = new _ControllerEventSinkWrapper(null); 734 let wrapper = new _ControllerEventSinkWrapper(null);
735 timeout = () => { 735 timeout = () => {
736 wrapper[_sink] = controller; 736 wrapper[_sink] = controller;
737 zone.runUnaryGuarded(onTimeout, wrapper); 737 zone.runUnaryGuarded(onTimeout, wrapper);
738 wrapper[_sink] = null; 738 wrapper[_sink] = null;
739 }; 739 };
740 } 740 }
741 subscription = this.listen(onData, {onError: onError, onDone: onDone}) ; 741 subscription = this.listen(onData, {onError: onError, onDone: onDone}) ;
742 timer = zone.createTimer(timeLimit, dart.as(timeout, dart.throw_("Unim plemented type () → void"))); 742 timer = zone.createTimer(timeLimit, dart.as(timeout, dart.throw_("Unim plemented type () → void")));
743 } 743 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 } 903 }
904 } 904 }
905 [_extractPending]() { 905 [_extractPending]() {
906 dart.assert(this[_isCanceled]); 906 dart.assert(this[_isCanceled]);
907 let events = this[_pending]; 907 let events = this[_pending];
908 this[_pending] = null; 908 this[_pending] = null;
909 return events; 909 return events;
910 } 910 }
911 onData(handleData) { 911 onData(handleData) {
912 if (handleData == null) 912 if (handleData == null)
913 handleData = dart.closureWrap(_nullDataHandler, "(T) → void"); 913 handleData = dart.as(_nullDataHandler, dart.throw_("Unimplemented type (T) → void"));
914 this[_onData] = dart.closureWrap(this[_zone].registerUnaryCallback(handl eData), "(T) → void"); 914 this[_onData] = dart.as(this[_zone].registerUnaryCallback(handleData), _ DataHandler);
915 } 915 }
916 onError(handleError) { 916 onError(handleError) {
917 if (handleError == null) 917 if (handleError == null)
918 handleError = _nullErrorHandler; 918 handleError = _nullErrorHandler;
919 this[_onError] = _registerErrorHandler(handleError, this[_zone]); 919 this[_onError] = _registerErrorHandler(handleError, this[_zone]);
920 } 920 }
921 onDone(handleDone) { 921 onDone(handleDone) {
922 if (handleDone == null) 922 if (handleDone == null)
923 handleDone = _nullDoneHandler; 923 handleDone = _nullDoneHandler;
924 this[_onDone] = this[_zone].registerCallback(handleDone); 924 this[_onDone] = this[_zone].registerCallback(handleDone);
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 } 1489 }
1490 [_sendError](error, stackTrace) { 1490 [_sendError](error, stackTrace) {
1491 if (this[_isEmpty]) 1491 if (this[_isEmpty])
1492 return; 1492 return;
1493 this[_forEachListener]((subscription) => { 1493 this[_forEachListener]((subscription) => {
1494 subscription._addError(error, stackTrace); 1494 subscription._addError(error, stackTrace);
1495 }); 1495 });
1496 } 1496 }
1497 [_sendDone]() { 1497 [_sendDone]() {
1498 if (!dart.notNull(this[_isEmpty])) { 1498 if (!dart.notNull(this[_isEmpty])) {
1499 this[_forEachListener](dart.closureWrap((subscription) => { 1499 this[_forEachListener](dart.as((subscription) => {
1500 subscription._close(); 1500 subscription._close();
1501 }, "(_BufferingStreamSubscription<T>) → void")); 1501 }, dart.throw_("Unimplemented type (_BufferingStreamSubscription<T>) → void")));
1502 } else { 1502 } else {
1503 dart.assert(this[_doneFuture] != null); 1503 dart.assert(this[_doneFuture] != null);
1504 dart.assert(this[_doneFuture][_mayComplete]); 1504 dart.assert(this[_doneFuture][_mayComplete]);
1505 this[_doneFuture]._asyncComplete(null); 1505 this[_doneFuture]._asyncComplete(null);
1506 } 1506 }
1507 } 1507 }
1508 } 1508 }
1509 return _SyncBroadcastStreamController; 1509 return _SyncBroadcastStreamController;
1510 }); 1510 });
1511 let _SyncBroadcastStreamController = _SyncBroadcastStreamController$(); 1511 let _SyncBroadcastStreamController = _SyncBroadcastStreamController$();
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
2080 this[_state] = _Future[_CHAINED]; 2080 this[_state] = _Future[_CHAINED];
2081 } else { 2081 } else {
2082 dart.assert(this[_isChained]); 2082 dart.assert(this[_isChained]);
2083 this[_state] = _Future[_INCOMPLETE]; 2083 this[_state] = _Future[_INCOMPLETE];
2084 } 2084 }
2085 } 2085 }
2086 then(f, opts) { 2086 then(f, opts) {
2087 let onError = opts && 'onError' in opts ? opts.onError : null; 2087 let onError = opts && 'onError' in opts ? opts.onError : null;
2088 let result = new _Future(); 2088 let result = new _Future();
2089 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { 2089 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) {
2090 f = dart.closureWrap(result[_zone].registerUnaryCallback(f), "(T) → dy namic"); 2090 f = dart.as(result[_zone].registerUnaryCallback(f), dart.throw_("Unimp lemented type (T) → dynamic"));
2091 if (onError != null) { 2091 if (onError != null) {
2092 onError = _registerErrorHandler(onError, result[_zone]); 2092 onError = _registerErrorHandler(onError, result[_zone]);
2093 } 2093 }
2094 } 2094 }
2095 this[_addListener](new _FutureListener.then(result, f, onError)); 2095 this[_addListener](new _FutureListener.then(result, f, onError));
2096 return result; 2096 return result;
2097 } 2097 }
2098 catchError(onError, opts) { 2098 catchError(onError, opts) {
2099 let test = opts && 'test' in opts ? opts.test : null; 2099 let test = opts && 'test' in opts ? opts.test : null;
2100 let result = new _Future(); 2100 let result = new _Future();
2101 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { 2101 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) {
2102 onError = _registerErrorHandler(onError, result[_zone]); 2102 onError = _registerErrorHandler(onError, result[_zone]);
2103 if (test != null) 2103 if (test != null)
2104 test = dart.closureWrap(result[_zone].registerUnaryCallback(test), " (dynamic) → bool"); 2104 test = dart.as(result[_zone].registerUnaryCallback(test), dart.throw _("Unimplemented type (dynamic) → bool"));
2105 } 2105 }
2106 this[_addListener](new _FutureListener.catchError(result, onError, test) ); 2106 this[_addListener](new _FutureListener.catchError(result, onError, test) );
2107 return result; 2107 return result;
2108 } 2108 }
2109 whenComplete(action) { 2109 whenComplete(action) {
2110 let result = new (_Future$(T))(); 2110 let result = new (_Future$(T))();
2111 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { 2111 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) {
2112 action = result[_zone].registerCallback(action); 2112 action = result[_zone].registerCallback(action);
2113 } 2113 }
2114 this[_addListener](new _FutureListener.whenComplete(result, action)); 2114 this[_addListener](new _FutureListener.whenComplete(result, action));
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after
3442 let _onListenHandler = Symbol('_onListenHandler'); 3442 let _onListenHandler = Symbol('_onListenHandler');
3443 let _onCancelHandler = Symbol('_onCancelHandler'); 3443 let _onCancelHandler = Symbol('_onCancelHandler');
3444 let _cancelSubscription = Symbol('_cancelSubscription'); 3444 let _cancelSubscription = Symbol('_cancelSubscription');
3445 let _pauseSubscription = Symbol('_pauseSubscription'); 3445 let _pauseSubscription = Symbol('_pauseSubscription');
3446 let _resumeSubscription = Symbol('_resumeSubscription'); 3446 let _resumeSubscription = Symbol('_resumeSubscription');
3447 let _isSubscriptionPaused = Symbol('_isSubscriptionPaused'); 3447 let _isSubscriptionPaused = Symbol('_isSubscriptionPaused');
3448 let _AsBroadcastStream$ = dart.generic(function(T) { 3448 let _AsBroadcastStream$ = dart.generic(function(T) {
3449 class _AsBroadcastStream extends Stream$(T) { 3449 class _AsBroadcastStream extends Stream$(T) {
3450 _AsBroadcastStream(source$, onListenHandler, onCancelHandler) { 3450 _AsBroadcastStream(source$, onListenHandler, onCancelHandler) {
3451 this[_source] = source$; 3451 this[_source] = source$;
3452 this[_onListenHandler] = dart.closureWrap(Zone.current.registerUnaryCall back(onListenHandler), "(StreamSubscription<dynamic>) → void"); 3452 this[_onListenHandler] = dart.as(Zone.current.registerUnaryCallback(onLi stenHandler), _broadcastCallback);
3453 this[_onCancelHandler] = dart.closureWrap(Zone.current.registerUnaryCall back(onCancelHandler), "(StreamSubscription<dynamic>) → void"); 3453 this[_onCancelHandler] = dart.as(Zone.current.registerUnaryCallback(onCa ncelHandler), _broadcastCallback);
3454 this[_zone] = Zone.current; 3454 this[_zone] = Zone.current;
3455 this[_controller] = null; 3455 this[_controller] = null;
3456 this[_subscription] = null; 3456 this[_subscription] = null;
3457 super.Stream(); 3457 super.Stream();
3458 this[_controller] = new (_AsBroadcastStreamController$(T))(this[_onListe n], this[_onCancel]); 3458 this[_controller] = new (_AsBroadcastStreamController$(T))(this[_onListe n], this[_onCancel]);
3459 } 3459 }
3460 get isBroadcast() { 3460 get isBroadcast() {
3461 return true; 3461 return true;
3462 } 3462 }
3463 listen(onData, opts) { 3463 listen(onData, opts) {
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
4227 _BoundSinkStream(stream$, sinkMapper) { 4227 _BoundSinkStream(stream$, sinkMapper) {
4228 this[_stream] = stream$; 4228 this[_stream] = stream$;
4229 this[_sinkMapper] = sinkMapper; 4229 this[_sinkMapper] = sinkMapper;
4230 super.Stream(); 4230 super.Stream();
4231 } 4231 }
4232 listen(onData, opts) { 4232 listen(onData, opts) {
4233 let onError = opts && 'onError' in opts ? opts.onError : null; 4233 let onError = opts && 'onError' in opts ? opts.onError : null;
4234 let onDone = opts && 'onDone' in opts ? opts.onDone : null; 4234 let onDone = opts && 'onDone' in opts ? opts.onDone : null;
4235 let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError : null; 4235 let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError : null;
4236 cancelOnError = core.identical(true, cancelOnError); 4236 cancelOnError = core.identical(true, cancelOnError);
4237 let subscription = new _SinkTransformerStreamSubscription(this[_stream], dart.closureWrap(this[_sinkMapper], "(EventSink<dynamic>) → EventSink"), onData , onError, onDone, cancelOnError); 4237 let subscription = new _SinkTransformerStreamSubscription(this[_stream], dart.as(this[_sinkMapper], _SinkMapper), onData, onError, onDone, cancelOnError );
4238 return subscription; 4238 return subscription;
4239 } 4239 }
4240 } 4240 }
4241 return _BoundSinkStream; 4241 return _BoundSinkStream;
4242 }); 4242 });
4243 let _BoundSinkStream = _BoundSinkStream$(); 4243 let _BoundSinkStream = _BoundSinkStream$();
4244 let _TransformDataHandler$ = dart.generic(function(S, T) { 4244 let _TransformDataHandler$ = dart.generic(function(S, T) {
4245 class _TransformDataHandler extends core.Function {} 4245 class _TransformDataHandler extends core.Function {}
4246 return _TransformDataHandler; 4246 return _TransformDataHandler;
4247 }); 4247 });
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
4282 let _HandlerEventSink = _HandlerEventSink$(); 4282 let _HandlerEventSink = _HandlerEventSink$();
4283 let _defaultHandleData = Symbol('_defaultHandleData'); 4283 let _defaultHandleData = Symbol('_defaultHandleData');
4284 let _defaultHandleError = Symbol('_defaultHandleError'); 4284 let _defaultHandleError = Symbol('_defaultHandleError');
4285 let _defaultHandleDone = Symbol('_defaultHandleDone'); 4285 let _defaultHandleDone = Symbol('_defaultHandleDone');
4286 let _StreamHandlerTransformer$ = dart.generic(function(S, T) { 4286 let _StreamHandlerTransformer$ = dart.generic(function(S, T) {
4287 class _StreamHandlerTransformer extends _StreamSinkTransformer$(S, T) { 4287 class _StreamHandlerTransformer extends _StreamSinkTransformer$(S, T) {
4288 _StreamHandlerTransformer(opts) { 4288 _StreamHandlerTransformer(opts) {
4289 let handleData = opts && 'handleData' in opts ? opts.handleData : null; 4289 let handleData = opts && 'handleData' in opts ? opts.handleData : null;
4290 let handleError = opts && 'handleError' in opts ? opts.handleError : nul l; 4290 let handleError = opts && 'handleError' in opts ? opts.handleError : nul l;
4291 let handleDone = opts && 'handleDone' in opts ? opts.handleDone : null; 4291 let handleDone = opts && 'handleDone' in opts ? opts.handleDone : null;
4292 super._StreamSinkTransformer(dart.closureWrap((outputSink) => { 4292 super._StreamSinkTransformer(dart.as((outputSink) => {
4293 if (handleData == null) 4293 if (handleData == null)
4294 handleData = dart.closureWrap(_StreamHandlerTransformer[_defaultHand leData], "(S, EventSink<T>) → void"); 4294 handleData = dart.as(_StreamHandlerTransformer[_defaultHandleData], dart.throw_("Unimplemented type (S, EventSink<T>) → void"));
4295 if (handleError == null) 4295 if (handleError == null)
4296 handleError = dart.closureWrap(_StreamHandlerTransformer[_defaultHan dleError], "(Object, StackTrace, EventSink<T>) → void"); 4296 handleError = dart.as(_StreamHandlerTransformer[_defaultHandleError] , dart.throw_("Unimplemented type (Object, StackTrace, EventSink<T>) → void"));
4297 if (handleDone == null) 4297 if (handleDone == null)
4298 handleDone = _StreamHandlerTransformer[_defaultHandleDone]; 4298 handleDone = _StreamHandlerTransformer[_defaultHandleDone];
4299 return new (_HandlerEventSink$(S, T))(handleData, handleError, handleD one, outputSink); 4299 return new (_HandlerEventSink$(S, T))(handleData, handleError, handleD one, outputSink);
4300 }, "(EventSink<T>) → EventSink<S>")); 4300 }, _SinkMapper));
4301 } 4301 }
4302 bind(stream) { 4302 bind(stream) {
4303 return super.bind(stream); 4303 return super.bind(stream);
4304 } 4304 }
4305 static [_defaultHandleData](data, sink) { 4305 static [_defaultHandleData](data, sink) {
4306 sink.add(data); 4306 sink.add(data);
4307 } 4307 }
4308 static [_defaultHandleError](error, stackTrace, sink) { 4308 static [_defaultHandleError](error, stackTrace, sink) {
4309 sink.addError(error); 4309 sink.addError(error);
4310 } 4310 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
4362 Timer(duration, callback) { 4362 Timer(duration, callback) {
4363 if (dart.equals(Zone.current, Zone.ROOT)) { 4363 if (dart.equals(Zone.current, Zone.ROOT)) {
4364 return Zone.current.createTimer(duration, callback); 4364 return Zone.current.createTimer(duration, callback);
4365 } 4365 }
4366 return Zone.current.createTimer(duration, Zone.current.bindCallback(callba ck, {runGuarded: true})); 4366 return Zone.current.createTimer(duration, Zone.current.bindCallback(callba ck, {runGuarded: true}));
4367 } 4367 }
4368 periodic(duration, callback) { 4368 periodic(duration, callback) {
4369 if (dart.equals(Zone.current, Zone.ROOT)) { 4369 if (dart.equals(Zone.current, Zone.ROOT)) {
4370 return Zone.current.createPeriodicTimer(duration, callback); 4370 return Zone.current.createPeriodicTimer(duration, callback);
4371 } 4371 }
4372 return Zone.current.createPeriodicTimer(duration, dart.closureWrap(Zone.cu rrent.bindUnaryCallback(callback, {runGuarded: true}), "(Timer) → void")); 4372 return Zone.current.createPeriodicTimer(duration, dart.as(Zone.current.bin dUnaryCallback(callback, {runGuarded: true}), dart.throw_("Unimplemented type (T imer) → void")));
4373 } 4373 }
4374 static run(callback) { 4374 static run(callback) {
4375 new Timer(core.Duration.ZERO, callback); 4375 new Timer(core.Duration.ZERO, callback);
4376 } 4376 }
4377 static [_createTimer](duration, callback) { 4377 static [_createTimer](duration, callback) {
4378 let milliseconds = duration.inMilliseconds; 4378 let milliseconds = duration.inMilliseconds;
4379 if (dart.notNull(milliseconds) < 0) 4379 if (dart.notNull(milliseconds) < 0)
4380 milliseconds = 0; 4380 milliseconds = 0;
4381 return new _isolate_helper.TimerImpl(milliseconds, callback); 4381 return new _isolate_helper.TimerImpl(milliseconds, callback);
4382 } 4382 }
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
4850 // Function _rootCreateTimer: (Zone, ZoneDelegate, Zone, Duration, () → void) → Timer 4850 // Function _rootCreateTimer: (Zone, ZoneDelegate, Zone, Duration, () → void) → Timer
4851 function _rootCreateTimer(self, parent, zone, duration, callback) { 4851 function _rootCreateTimer(self, parent, zone, duration, callback) {
4852 if (!dart.notNull(core.identical(_ROOT_ZONE, zone))) { 4852 if (!dart.notNull(core.identical(_ROOT_ZONE, zone))) {
4853 callback = zone.bindCallback(callback); 4853 callback = zone.bindCallback(callback);
4854 } 4854 }
4855 return Timer._createTimer(duration, callback); 4855 return Timer._createTimer(duration, callback);
4856 } 4856 }
4857 // Function _rootCreatePeriodicTimer: (Zone, ZoneDelegate, Zone, Duration, (Ti mer) → void) → Timer 4857 // Function _rootCreatePeriodicTimer: (Zone, ZoneDelegate, Zone, Duration, (Ti mer) → void) → Timer
4858 function _rootCreatePeriodicTimer(self, parent, zone, duration, callback) { 4858 function _rootCreatePeriodicTimer(self, parent, zone, duration, callback) {
4859 if (!dart.notNull(core.identical(_ROOT_ZONE, zone))) { 4859 if (!dart.notNull(core.identical(_ROOT_ZONE, zone))) {
4860 callback = dart.closureWrap(zone.bindUnaryCallback(callback), "(Timer) → v oid"); 4860 callback = dart.as(zone.bindUnaryCallback(callback), dart.throw_("Unimplem ented type (Timer) → void"));
4861 } 4861 }
4862 return Timer._createPeriodicTimer(duration, callback); 4862 return Timer._createPeriodicTimer(duration, callback);
4863 } 4863 }
4864 // Function _rootPrint: (Zone, ZoneDelegate, Zone, String) → void 4864 // Function _rootPrint: (Zone, ZoneDelegate, Zone, String) → void
4865 function _rootPrint(self, parent, zone, line) { 4865 function _rootPrint(self, parent, zone, line) {
4866 _internal.printToConsole(line); 4866 _internal.printToConsole(line);
4867 } 4867 }
4868 // Function _printToZone: (String) → void 4868 // Function _printToZone: (String) → void
4869 function _printToZone(line) { 4869 function _printToZone(line) {
4870 Zone.current.print(line); 4870 Zone.current.print(line);
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
5193 exports.ScheduleMicrotaskHandler = ScheduleMicrotaskHandler; 5193 exports.ScheduleMicrotaskHandler = ScheduleMicrotaskHandler;
5194 exports.CreateTimerHandler = CreateTimerHandler; 5194 exports.CreateTimerHandler = CreateTimerHandler;
5195 exports.CreatePeriodicTimerHandler = CreatePeriodicTimerHandler; 5195 exports.CreatePeriodicTimerHandler = CreatePeriodicTimerHandler;
5196 exports.PrintHandler = PrintHandler; 5196 exports.PrintHandler = PrintHandler;
5197 exports.ForkHandler = ForkHandler; 5197 exports.ForkHandler = ForkHandler;
5198 exports.ZoneSpecification = ZoneSpecification; 5198 exports.ZoneSpecification = ZoneSpecification;
5199 exports.ZoneDelegate = ZoneDelegate; 5199 exports.ZoneDelegate = ZoneDelegate;
5200 exports.Zone = Zone; 5200 exports.Zone = Zone;
5201 exports.runZoned = runZoned; 5201 exports.runZoned = runZoned;
5202 })(async || (async = {})); 5202 })(async || (async = {}));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698