OLD | NEW |
1 dart_library.library('dart/async', null, /* Imports */[ | 1 dart_library.library('dart/async', null, /* Imports */[ |
2 "dart/_runtime", | 2 "dart/_runtime", |
3 'dart/core', | 3 'dart/core', |
4 'dart/_internal', | 4 'dart/_internal', |
5 'dart/collection' | 5 'dart/collection' |
6 ], /* Lazy imports */[ | 6 ], /* Lazy imports */[ |
7 'dart/_isolate_helper' | 7 'dart/_isolate_helper' |
8 ], function(exports, dart, core, _internal, collection, _isolate_helper) { | 8 ], function(exports, dart, core, _internal, collection, _isolate_helper) { |
9 'use strict'; | 9 'use strict'; |
10 let dartx = dart.dartx; | 10 let dartx = dart.dartx; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 timer = null; | 135 timer = null; |
136 })}); | 136 })}); |
137 return controller.stream; | 137 return controller.stream; |
138 } | 138 } |
139 static eventTransformed(source, mapSink) { | 139 static eventTransformed(source, mapSink) { |
140 return new (_BoundSinkStream$(dart.dynamic, T))(source, dart.as(mapSink,
_SinkMapper)); | 140 return new (_BoundSinkStream$(dart.dynamic, T))(source, dart.as(mapSink,
_SinkMapper)); |
141 } | 141 } |
142 get isBroadcast() { | 142 get isBroadcast() { |
143 return false; | 143 return false; |
144 } | 144 } |
145 asBroadcastStream(opts) { | 145 asBroadcastStream({onListen = null, onCancel = null} = {}) { |
146 let onListen = opts && 'onListen' in opts ? opts.onListen : null; | |
147 dart.as(onListen, dart.functionType(dart.void, [StreamSubscription$(T)])
); | 146 dart.as(onListen, dart.functionType(dart.void, [StreamSubscription$(T)])
); |
148 let onCancel = opts && 'onCancel' in opts ? opts.onCancel : null; | |
149 dart.as(onCancel, dart.functionType(dart.void, [StreamSubscription$(T)])
); | 147 dart.as(onCancel, dart.functionType(dart.void, [StreamSubscription$(T)])
); |
150 return new (_AsBroadcastStream$(T))(this, dart.as(onListen, __CastType12
), dart.as(onCancel, dart.functionType(dart.void, [StreamSubscription]))); | 148 return new (_AsBroadcastStream$(T))(this, dart.as(onListen, __CastType12
), dart.as(onCancel, dart.functionType(dart.void, [StreamSubscription]))); |
151 } | 149 } |
152 where(test) { | 150 where(test) { |
153 dart.as(test, dart.functionType(core.bool, [T])); | 151 dart.as(test, dart.functionType(core.bool, [T])); |
154 return new (_WhereStream$(T))(this, test); | 152 return new (_WhereStream$(T))(this, test); |
155 } | 153 } |
156 map(convert) { | 154 map(convert) { |
157 dart.as(convert, dart.functionType(dart.dynamic, [T])); | 155 dart.as(convert, dart.functionType(dart.dynamic, [T])); |
158 return new (_MapStream$(T, dart.dynamic))(this, convert); | 156 return new (_MapStream$(T, dart.dynamic))(this, convert); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 controller = StreamController.new({onListen: onListen, onPause: dart.f
n(() => { | 232 controller = StreamController.new({onListen: onListen, onPause: dart.f
n(() => { |
235 subscription.pause(); | 233 subscription.pause(); |
236 }), onResume: dart.fn(() => { | 234 }), onResume: dart.fn(() => { |
237 subscription.resume(); | 235 subscription.resume(); |
238 }), onCancel: dart.fn(() => { | 236 }), onCancel: dart.fn(() => { |
239 subscription.cancel(); | 237 subscription.cancel(); |
240 }), sync: true}); | 238 }), sync: true}); |
241 } | 239 } |
242 return controller.stream; | 240 return controller.stream; |
243 } | 241 } |
244 handleError(onError, opts) { | 242 handleError(onError, {test = null} = {}) { |
245 let test = opts && 'test' in opts ? opts.test : null; | |
246 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); | 243 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); |
247 return new (_HandleErrorStream$(T))(this, onError, test); | 244 return new (_HandleErrorStream$(T))(this, onError, test); |
248 } | 245 } |
249 expand(convert) { | 246 expand(convert) { |
250 dart.as(convert, dart.functionType(core.Iterable, [T])); | 247 dart.as(convert, dart.functionType(core.Iterable, [T])); |
251 return new (_ExpandStream$(T, dart.dynamic))(this, convert); | 248 return new (_ExpandStream$(T, dart.dynamic))(this, convert); |
252 } | 249 } |
253 pipe(streamConsumer) { | 250 pipe(streamConsumer) { |
254 dart.as(streamConsumer, StreamConsumer$(T)); | 251 dart.as(streamConsumer, StreamConsumer$(T)); |
255 return streamConsumer.addStream(this).then(dart.fn(_ => streamConsumer.c
lose(), Future, [dart.dynamic])); | 252 return streamConsumer.addStream(this).then(dart.fn(_ => streamConsumer.c
lose(), Future, [dart.dynamic])); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 try { | 526 try { |
530 dart.throw(_internal.IterableElementError.noElement()); | 527 dart.throw(_internal.IterableElementError.noElement()); |
531 } catch (e) { | 528 } catch (e) { |
532 let s = dart.stackTrace(e); | 529 let s = dart.stackTrace(e); |
533 _completeWithErrorCallback(future, e, s); | 530 _completeWithErrorCallback(future, e, s); |
534 } | 531 } |
535 | 532 |
536 }), cancelOnError: true}); | 533 }), cancelOnError: true}); |
537 return future; | 534 return future; |
538 } | 535 } |
539 firstWhere(test, opts) { | 536 firstWhere(test, {defaultValue = null} = {}) { |
540 dart.as(test, dart.functionType(core.bool, [T])); | 537 dart.as(test, dart.functionType(core.bool, [T])); |
541 let defaultValue = opts && 'defaultValue' in opts ? opts.defaultValue :
null; | |
542 dart.as(defaultValue, dart.functionType(core.Object, [])); | 538 dart.as(defaultValue, dart.functionType(core.Object, [])); |
543 let future = new _Future(); | 539 let future = new _Future(); |
544 let subscription = null; | 540 let subscription = null; |
545 subscription = this.listen(dart.fn(value => { | 541 subscription = this.listen(dart.fn(value => { |
546 dart.as(value, T); | 542 dart.as(value, T); |
547 _runUserCode(dart.fn(() => test(value), core.bool, []), dart.fn(isMatc
h => { | 543 _runUserCode(dart.fn(() => test(value), core.bool, []), dart.fn(isMatc
h => { |
548 if (dart.notNull(isMatch)) { | 544 if (dart.notNull(isMatch)) { |
549 _cancelAndValue(subscription, future, value); | 545 _cancelAndValue(subscription, future, value); |
550 } | 546 } |
551 }, dart.dynamic, [core.bool]), dart.as(_cancelAndErrorClosure(subscrip
tion, future), dart.functionType(dart.dynamic, [dart.dynamic, core.StackTrace]))
); | 547 }, dart.dynamic, [core.bool]), dart.as(_cancelAndErrorClosure(subscrip
tion, future), dart.functionType(dart.dynamic, [dart.dynamic, core.StackTrace]))
); |
552 }, dart.dynamic, [T]), {onError: dart.bind(future, _completeError), onDo
ne: dart.fn(() => { | 548 }, dart.dynamic, [T]), {onError: dart.bind(future, _completeError), onDo
ne: dart.fn(() => { |
553 if (defaultValue != null) { | 549 if (defaultValue != null) { |
554 _runUserCode(defaultValue, dart.bind(future, _complete), dart.bind
(future, _completeError)); | 550 _runUserCode(defaultValue, dart.bind(future, _complete), dart.bind
(future, _completeError)); |
555 return; | 551 return; |
556 } | 552 } |
557 try { | 553 try { |
558 dart.throw(_internal.IterableElementError.noElement()); | 554 dart.throw(_internal.IterableElementError.noElement()); |
559 } catch (e) { | 555 } catch (e) { |
560 let s = dart.stackTrace(e); | 556 let s = dart.stackTrace(e); |
561 _completeWithErrorCallback(future, e, s); | 557 _completeWithErrorCallback(future, e, s); |
562 } | 558 } |
563 | 559 |
564 }), cancelOnError: true}); | 560 }), cancelOnError: true}); |
565 return future; | 561 return future; |
566 } | 562 } |
567 lastWhere(test, opts) { | 563 lastWhere(test, {defaultValue = null} = {}) { |
568 dart.as(test, dart.functionType(core.bool, [T])); | 564 dart.as(test, dart.functionType(core.bool, [T])); |
569 let defaultValue = opts && 'defaultValue' in opts ? opts.defaultValue :
null; | |
570 dart.as(defaultValue, dart.functionType(core.Object, [])); | 565 dart.as(defaultValue, dart.functionType(core.Object, [])); |
571 let future = new _Future(); | 566 let future = new _Future(); |
572 let result = null; | 567 let result = null; |
573 let foundResult = false; | 568 let foundResult = false; |
574 let subscription = null; | 569 let subscription = null; |
575 subscription = this.listen(dart.fn(value => { | 570 subscription = this.listen(dart.fn(value => { |
576 dart.as(value, T); | 571 dart.as(value, T); |
577 _runUserCode(dart.fn(() => true == test(value), core.bool, []), dart.f
n(isMatch => { | 572 _runUserCode(dart.fn(() => true == test(value), core.bool, []), dart.f
n(isMatch => { |
578 if (dart.notNull(isMatch)) { | 573 if (dart.notNull(isMatch)) { |
579 foundResult = true; | 574 foundResult = true; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 if (index == elementIndex) { | 644 if (index == elementIndex) { |
650 _cancelAndValue(subscription, future, value); | 645 _cancelAndValue(subscription, future, value); |
651 return; | 646 return; |
652 } | 647 } |
653 elementIndex = dart.notNull(elementIndex) + 1; | 648 elementIndex = dart.notNull(elementIndex) + 1; |
654 }, dart.dynamic, [T]), {onError: dart.bind(future, _completeError), onDo
ne: dart.fn((() => { | 649 }, dart.dynamic, [T]), {onError: dart.bind(future, _completeError), onDo
ne: dart.fn((() => { |
655 future[_completeError](core.RangeError.index(index, this, "index", n
ull, elementIndex)); | 650 future[_completeError](core.RangeError.index(index, this, "index", n
ull, elementIndex)); |
656 }).bind(this)), cancelOnError: true}); | 651 }).bind(this)), cancelOnError: true}); |
657 return future; | 652 return future; |
658 } | 653 } |
659 timeout(timeLimit, opts) { | 654 timeout(timeLimit, {onTimeout = null} = {}) { |
660 let onTimeout = opts && 'onTimeout' in opts ? opts.onTimeout : null; | |
661 dart.as(onTimeout, dart.functionType(dart.void, [EventSink])); | 655 dart.as(onTimeout, dart.functionType(dart.void, [EventSink])); |
662 let controller = null; | 656 let controller = null; |
663 let subscription = null; | 657 let subscription = null; |
664 let timer = null; | 658 let timer = null; |
665 let zone = null; | 659 let zone = null; |
666 let timeout2 = null; | 660 let timeout2 = null; |
667 function onData(event) { | 661 function onData(event) { |
668 dart.as(event, T); | 662 dart.as(event, T); |
669 timer.cancel(); | 663 timer.cancel(); |
670 controller.add(event); | 664 controller.add(event); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 return Stream; | 757 return Stream; |
764 }); | 758 }); |
765 let Stream = Stream$(); | 759 let Stream = Stream$(); |
766 const _createSubscription = Symbol('_createSubscription'); | 760 const _createSubscription = Symbol('_createSubscription'); |
767 const _onListen = Symbol('_onListen'); | 761 const _onListen = Symbol('_onListen'); |
768 const _StreamImpl$ = dart.generic(function(T) { | 762 const _StreamImpl$ = dart.generic(function(T) { |
769 class _StreamImpl extends Stream$(T) { | 763 class _StreamImpl extends Stream$(T) { |
770 _StreamImpl() { | 764 _StreamImpl() { |
771 super.Stream(); | 765 super.Stream(); |
772 } | 766 } |
773 listen(onData, opts) { | 767 listen(onData, {onError = null, onDone = null, cancelOnError = null} = {})
{ |
774 dart.as(onData, dart.functionType(dart.void, [T])); | 768 dart.as(onData, dart.functionType(dart.void, [T])); |
775 let onError = opts && 'onError' in opts ? opts.onError : null; | |
776 let onDone = opts && 'onDone' in opts ? opts.onDone : null; | |
777 dart.as(onDone, dart.functionType(dart.void, [])); | 769 dart.as(onDone, dart.functionType(dart.void, [])); |
778 let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError
: null; | |
779 cancelOnError = core.identical(true, cancelOnError); | 770 cancelOnError = core.identical(true, cancelOnError); |
780 let subscription = this[_createSubscription](onData, onError, onDone, ca
ncelOnError); | 771 let subscription = this[_createSubscription](onData, onError, onDone, ca
ncelOnError); |
781 this[_onListen](subscription); | 772 this[_onListen](subscription); |
782 return dart.as(subscription, StreamSubscription$(T)); | 773 return dart.as(subscription, StreamSubscription$(T)); |
783 } | 774 } |
784 [_createSubscription](onData, onError, onDone, cancelOnError) { | 775 [_createSubscription](onData, onError, onDone, cancelOnError) { |
785 dart.as(onData, dart.functionType(dart.void, [T])); | 776 dart.as(onData, dart.functionType(dart.void, [T])); |
786 dart.as(onDone, dart.functionType(dart.void, [])); | 777 dart.as(onDone, dart.functionType(dart.void, [])); |
787 return new (_BufferingStreamSubscription$(T))(onData, onError, onDone, c
ancelOnError); | 778 return new (_BufferingStreamSubscription$(T))(onData, onError, onDone, c
ancelOnError); |
788 } | 779 } |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1447 if (!dart.notNull(this[_mayAddEvent])) | 1438 if (!dart.notNull(this[_mayAddEvent])) |
1448 dart.throw(this[_addEventError]()); | 1439 dart.throw(this[_addEventError]()); |
1449 this[_state] = dart.notNull(this[_state]) | dart.notNull(_BroadcastStrea
mController$()._STATE_CLOSED); | 1440 this[_state] = dart.notNull(this[_state]) | dart.notNull(_BroadcastStrea
mController$()._STATE_CLOSED); |
1450 let doneFuture = this[_ensureDoneFuture](); | 1441 let doneFuture = this[_ensureDoneFuture](); |
1451 this[_sendDone](); | 1442 this[_sendDone](); |
1452 return doneFuture; | 1443 return doneFuture; |
1453 } | 1444 } |
1454 get done() { | 1445 get done() { |
1455 return this[_ensureDoneFuture](); | 1446 return this[_ensureDoneFuture](); |
1456 } | 1447 } |
1457 addStream(stream, opts) { | 1448 addStream(stream, {cancelOnError = true} = {}) { |
1458 dart.as(stream, Stream$(T)); | 1449 dart.as(stream, Stream$(T)); |
1459 let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError
: true; | |
1460 if (!dart.notNull(this[_mayAddEvent])) | 1450 if (!dart.notNull(this[_mayAddEvent])) |
1461 dart.throw(this[_addEventError]()); | 1451 dart.throw(this[_addEventError]()); |
1462 this[_state] = dart.notNull(this[_state]) | dart.notNull(_BroadcastStrea
mController$()._STATE_ADDSTREAM); | 1452 this[_state] = dart.notNull(this[_state]) | dart.notNull(_BroadcastStrea
mController$()._STATE_ADDSTREAM); |
1463 this[_addStreamState] = new (_AddStreamState$(T))(this, stream, cancelOn
Error); | 1453 this[_addStreamState] = new (_AddStreamState$(T))(this, stream, cancelOn
Error); |
1464 return this[_addStreamState].addStreamFuture; | 1454 return this[_addStreamState].addStreamFuture; |
1465 } | 1455 } |
1466 [_add](data) { | 1456 [_add](data) { |
1467 dart.as(data, T); | 1457 dart.as(data, T); |
1468 this[_sendData](data); | 1458 this[_sendData](data); |
1469 } | 1459 } |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 }); | 1760 }); |
1771 return _DoneSubscription; | 1761 return _DoneSubscription; |
1772 }); | 1762 }); |
1773 let _DoneSubscription = _DoneSubscription$(); | 1763 let _DoneSubscription = _DoneSubscription$(); |
1774 const __CastType2$ = dart.generic(function(T) { | 1764 const __CastType2$ = dart.generic(function(T) { |
1775 const __CastType2 = dart.typedef('__CastType2', () => dart.functionType(dart
.void, [_BufferingStreamSubscription$(T)])); | 1765 const __CastType2 = dart.typedef('__CastType2', () => dart.functionType(dart
.void, [_BufferingStreamSubscription$(T)])); |
1776 return __CastType2; | 1766 return __CastType2; |
1777 }); | 1767 }); |
1778 let __CastType2 = __CastType2$(); | 1768 let __CastType2 = __CastType2$(); |
1779 class DeferredLibrary extends core.Object { | 1769 class DeferredLibrary extends core.Object { |
1780 DeferredLibrary(libraryName, opts) { | 1770 DeferredLibrary(libraryName, {uri = null} = {}) { |
1781 let uri = opts && 'uri' in opts ? opts.uri : null; | |
1782 this.libraryName = libraryName; | 1771 this.libraryName = libraryName; |
1783 this.uri = uri; | 1772 this.uri = uri; |
1784 } | 1773 } |
1785 load() { | 1774 load() { |
1786 dart.throw('DeferredLibrary not supported. ' + 'please use the `import "li
b.dart" deferred as lib` syntax.'); | 1775 dart.throw('DeferredLibrary not supported. ' + 'please use the `import "li
b.dart" deferred as lib` syntax.'); |
1787 } | 1776 } |
1788 } | 1777 } |
1789 dart.setSignature(DeferredLibrary, { | 1778 dart.setSignature(DeferredLibrary, { |
1790 constructors: () => ({DeferredLibrary: [DeferredLibrary, [core.String], {uri
: core.String}]}), | 1779 constructors: () => ({DeferredLibrary: [DeferredLibrary, [core.String], {uri
: core.String}]}), |
1791 methods: () => ({load: [Future$(core.Null), []]}) | 1780 methods: () => ({load: [Future$(core.Null), []]}) |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 try { | 1858 try { |
1870 result[_complete](computation == null ? null : computation()); | 1859 result[_complete](computation == null ? null : computation()); |
1871 } catch (e) { | 1860 } catch (e) { |
1872 let s = dart.stackTrace(e); | 1861 let s = dart.stackTrace(e); |
1873 _completeWithErrorCallback(result, e, s); | 1862 _completeWithErrorCallback(result, e, s); |
1874 } | 1863 } |
1875 | 1864 |
1876 })); | 1865 })); |
1877 return dart.as(result, Future$(T)); | 1866 return dart.as(result, Future$(T)); |
1878 } | 1867 } |
1879 static wait(futures, opts) { | 1868 static wait(futures, {eagerError = false, cleanUp = null} = {}) { |
1880 let eagerError = opts && 'eagerError' in opts ? opts.eagerError : false; | |
1881 let cleanUp = opts && 'cleanUp' in opts ? opts.cleanUp : null; | |
1882 dart.as(cleanUp, dart.functionType(dart.void, [dart.dynamic])); | 1869 dart.as(cleanUp, dart.functionType(dart.void, [dart.dynamic])); |
1883 let result = new (_Future$(core.List))(); | 1870 let result = new (_Future$(core.List))(); |
1884 let values = null; | 1871 let values = null; |
1885 let remaining = 0; | 1872 let remaining = 0; |
1886 let error = null; | 1873 let error = null; |
1887 let stackTrace = null; | 1874 let stackTrace = null; |
1888 function handleError(theError, theStackTrace) { | 1875 function handleError(theError, theStackTrace) { |
1889 remaining = dart.notNull(remaining) - 1; | 1876 remaining = dart.notNull(remaining) - 1; |
1890 if (values != null) { | 1877 if (values != null) { |
1891 if (cleanUp != null) { | 1878 if (cleanUp != null) { |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2260 } | 2247 } |
2261 set [_isChained](value) { | 2248 set [_isChained](value) { |
2262 if (dart.notNull(value)) { | 2249 if (dart.notNull(value)) { |
2263 dart.assert(!dart.notNull(this[_isComplete])); | 2250 dart.assert(!dart.notNull(this[_isComplete])); |
2264 this[_state] = _Future$()._CHAINED; | 2251 this[_state] = _Future$()._CHAINED; |
2265 } else { | 2252 } else { |
2266 dart.assert(this[_isChained]); | 2253 dart.assert(this[_isChained]); |
2267 this[_state] = _Future$()._INCOMPLETE; | 2254 this[_state] = _Future$()._INCOMPLETE; |
2268 } | 2255 } |
2269 } | 2256 } |
2270 then(f, opts) { | 2257 then(f, {onError = null} = {}) { |
2271 dart.as(f, dart.functionType(dart.dynamic, [T])); | 2258 dart.as(f, dart.functionType(dart.dynamic, [T])); |
2272 let onError = opts && 'onError' in opts ? opts.onError : null; | |
2273 let result = new (_Future$())(); | 2259 let result = new (_Future$())(); |
2274 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { | 2260 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { |
2275 f = dart.as(result[_zone].registerUnaryCallback(f), __CastType6$(T)); | 2261 f = dart.as(result[_zone].registerUnaryCallback(f), __CastType6$(T)); |
2276 if (onError != null) { | 2262 if (onError != null) { |
2277 onError = _registerErrorHandler(onError, result[_zone]); | 2263 onError = _registerErrorHandler(onError, result[_zone]); |
2278 } | 2264 } |
2279 } | 2265 } |
2280 this[_addListener](new _FutureListener.then(result, f, onError)); | 2266 this[_addListener](new _FutureListener.then(result, f, onError)); |
2281 return result; | 2267 return result; |
2282 } | 2268 } |
2283 catchError(onError, opts) { | 2269 catchError(onError, {test = null} = {}) { |
2284 let test = opts && 'test' in opts ? opts.test : null; | |
2285 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); | 2270 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); |
2286 let result = new (_Future$())(); | 2271 let result = new (_Future$())(); |
2287 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { | 2272 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { |
2288 onError = _registerErrorHandler(onError, result[_zone]); | 2273 onError = _registerErrorHandler(onError, result[_zone]); |
2289 if (test != null) | 2274 if (test != null) |
2290 test = dart.as(result[_zone].registerUnaryCallback(test), __CastType
8); | 2275 test = dart.as(result[_zone].registerUnaryCallback(test), __CastType
8); |
2291 } | 2276 } |
2292 this[_addListener](new _FutureListener.catchError(result, onError, test)
); | 2277 this[_addListener](new _FutureListener.catchError(result, onError, test)
); |
2293 return result; | 2278 return result; |
2294 } | 2279 } |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 listeners = result[_removeListeners](); | 2579 listeners = result[_removeListeners](); |
2595 if (dart.notNull(listenerHasValue)) { | 2580 if (dart.notNull(listenerHasValue)) { |
2596 result[_setValue](listenerValueOrError); | 2581 result[_setValue](listenerValueOrError); |
2597 } else { | 2582 } else { |
2598 let asyncError = dart.as(listenerValueOrError, AsyncError); | 2583 let asyncError = dart.as(listenerValueOrError, AsyncError); |
2599 result[_setErrorObject](asyncError); | 2584 result[_setErrorObject](asyncError); |
2600 } | 2585 } |
2601 source = result; | 2586 source = result; |
2602 } | 2587 } |
2603 } | 2588 } |
2604 timeout(timeLimit, opts) { | 2589 timeout(timeLimit, {onTimeout = null} = {}) { |
2605 let onTimeout = opts && 'onTimeout' in opts ? opts.onTimeout : null; | |
2606 dart.as(onTimeout, dart.functionType(dart.dynamic, [])); | 2590 dart.as(onTimeout, dart.functionType(dart.dynamic, [])); |
2607 if (dart.notNull(this[_isComplete])) | 2591 if (dart.notNull(this[_isComplete])) |
2608 return new (_Future$()).immediate(this); | 2592 return new (_Future$()).immediate(this); |
2609 let result = new (_Future$())(); | 2593 let result = new (_Future$())(); |
2610 let timer = null; | 2594 let timer = null; |
2611 if (onTimeout == null) { | 2595 if (onTimeout == null) { |
2612 timer = Timer.new(timeLimit, dart.fn(() => { | 2596 timer = Timer.new(timeLimit, dart.fn(() => { |
2613 result[_completeError](new TimeoutException("Future not completed",
timeLimit)); | 2597 result[_completeError](new TimeoutException("Future not completed",
timeLimit)); |
2614 })); | 2598 })); |
2615 } else { | 2599 } else { |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2851 const _stream = Symbol('_stream'); | 2835 const _stream = Symbol('_stream'); |
2852 const StreamView$ = dart.generic(function(T) { | 2836 const StreamView$ = dart.generic(function(T) { |
2853 class StreamView extends Stream$(T) { | 2837 class StreamView extends Stream$(T) { |
2854 StreamView(stream) { | 2838 StreamView(stream) { |
2855 this[_stream] = stream; | 2839 this[_stream] = stream; |
2856 super.Stream(); | 2840 super.Stream(); |
2857 } | 2841 } |
2858 get isBroadcast() { | 2842 get isBroadcast() { |
2859 return this[_stream].isBroadcast; | 2843 return this[_stream].isBroadcast; |
2860 } | 2844 } |
2861 asBroadcastStream(opts) { | 2845 asBroadcastStream({onListen = null, onCancel = null} = {}) { |
2862 let onListen = opts && 'onListen' in opts ? opts.onListen : null; | |
2863 dart.as(onListen, dart.functionType(dart.void, [StreamSubscription$(T)])
); | 2846 dart.as(onListen, dart.functionType(dart.void, [StreamSubscription$(T)])
); |
2864 let onCancel = opts && 'onCancel' in opts ? opts.onCancel : null; | |
2865 dart.as(onCancel, dart.functionType(dart.void, [StreamSubscription$(T)])
); | 2847 dart.as(onCancel, dart.functionType(dart.void, [StreamSubscription$(T)])
); |
2866 return this[_stream].asBroadcastStream({onListen: onListen, onCancel: on
Cancel}); | 2848 return this[_stream].asBroadcastStream({onListen: onListen, onCancel: on
Cancel}); |
2867 } | 2849 } |
2868 listen(onData, opts) { | 2850 listen(onData, {onError = null, onDone = null, cancelOnError = null} = {})
{ |
2869 dart.as(onData, dart.functionType(dart.void, [T])); | 2851 dart.as(onData, dart.functionType(dart.void, [T])); |
2870 let onError = opts && 'onError' in opts ? opts.onError : null; | |
2871 let onDone = opts && 'onDone' in opts ? opts.onDone : null; | |
2872 dart.as(onDone, dart.functionType(dart.void, [])); | 2852 dart.as(onDone, dart.functionType(dart.void, [])); |
2873 let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError
: null; | |
2874 return this[_stream].listen(onData, {onError: onError, onDone: onDone, c
ancelOnError: cancelOnError}); | 2853 return this[_stream].listen(onData, {onError: onError, onDone: onDone, c
ancelOnError: cancelOnError}); |
2875 } | 2854 } |
2876 } | 2855 } |
2877 dart.setSignature(StreamView, { | 2856 dart.setSignature(StreamView, { |
2878 constructors: () => ({StreamView: [StreamView$(T), [Stream$(T)]]}), | 2857 constructors: () => ({StreamView: [StreamView$(T), [Stream$(T)]]}), |
2879 methods: () => ({ | 2858 methods: () => ({ |
2880 asBroadcastStream: [Stream$(T), [], {onListen: dart.functionType(dart.vo
id, [StreamSubscription$(T)]), onCancel: dart.functionType(dart.void, [StreamSub
scription$(T)])}], | 2859 asBroadcastStream: [Stream$(T), [], {onListen: dart.functionType(dart.vo
id, [StreamSubscription$(T)]), onCancel: dart.functionType(dart.void, [StreamSub
scription$(T)])}], |
2881 listen: [StreamSubscription$(T), [dart.functionType(dart.void, [T])], {o
nError: core.Function, onDone: dart.functionType(dart.void, []), cancelOnError:
core.bool}] | 2860 listen: [StreamSubscription$(T), [dart.functionType(dart.void, [T])], {o
nError: core.Function, onDone: dart.functionType(dart.void, []), cancelOnError:
core.bool}] |
2882 }) | 2861 }) |
2883 }); | 2862 }); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2954 }); | 2933 }); |
2955 return _ControllerEventSinkWrapper; | 2934 return _ControllerEventSinkWrapper; |
2956 }); | 2935 }); |
2957 let _ControllerEventSinkWrapper = _ControllerEventSinkWrapper$(); | 2936 let _ControllerEventSinkWrapper = _ControllerEventSinkWrapper$(); |
2958 const __CastType12 = dart.typedef('__CastType12', () => dart.functionType(dart
.void, [StreamSubscription])); | 2937 const __CastType12 = dart.typedef('__CastType12', () => dart.functionType(dart
.void, [StreamSubscription])); |
2959 const __CastType14 = dart.typedef('__CastType14', () => dart.functionType(dart
.dynamic, [dart.dynamic, core.StackTrace])); | 2938 const __CastType14 = dart.typedef('__CastType14', () => dart.functionType(dart
.dynamic, [dart.dynamic, core.StackTrace])); |
2960 const __CastType17 = dart.typedef('__CastType17', () => dart.functionType(dart
.void, [])); | 2939 const __CastType17 = dart.typedef('__CastType17', () => dart.functionType(dart
.void, [])); |
2961 const __CastType18 = dart.typedef('__CastType18', () => dart.functionType(dart
.void, [EventSink])); | 2940 const __CastType18 = dart.typedef('__CastType18', () => dart.functionType(dart
.void, [EventSink])); |
2962 const StreamController$ = dart.generic(function(T) { | 2941 const StreamController$ = dart.generic(function(T) { |
2963 class StreamController extends core.Object { | 2942 class StreamController extends core.Object { |
2964 static new(opts) { | 2943 static new({onListen = null, onPause = null, onResume = null, onCancel = n
ull, sync = false} = {}) { |
2965 let onListen = opts && 'onListen' in opts ? opts.onListen : null; | |
2966 let onPause = opts && 'onPause' in opts ? opts.onPause : null; | |
2967 let onResume = opts && 'onResume' in opts ? opts.onResume : null; | |
2968 let onCancel = opts && 'onCancel' in opts ? opts.onCancel : null; | |
2969 let sync = opts && 'sync' in opts ? opts.sync : false; | |
2970 if (onListen == null && onPause == null && onResume == null && onCancel
== null) { | 2944 if (onListen == null && onPause == null && onResume == null && onCancel
== null) { |
2971 return dart.as(dart.notNull(sync) ? new _NoCallbackSyncStreamControlle
r() : new _NoCallbackAsyncStreamController(), StreamController$(T)); | 2945 return dart.as(dart.notNull(sync) ? new _NoCallbackSyncStreamControlle
r() : new _NoCallbackAsyncStreamController(), StreamController$(T)); |
2972 } | 2946 } |
2973 return dart.notNull(sync) ? new (_SyncStreamController$(T))(onListen, on
Pause, onResume, onCancel) : new (_AsyncStreamController$(T))(onListen, onPause,
onResume, onCancel); | 2947 return dart.notNull(sync) ? new (_SyncStreamController$(T))(onListen, on
Pause, onResume, onCancel) : new (_AsyncStreamController$(T))(onListen, onPause,
onResume, onCancel); |
2974 } | 2948 } |
2975 static broadcast(opts) { | 2949 static broadcast({onListen = null, onCancel = null, sync = false} = {}) { |
2976 let onListen = opts && 'onListen' in opts ? opts.onListen : null; | |
2977 let onCancel = opts && 'onCancel' in opts ? opts.onCancel : null; | |
2978 let sync = opts && 'sync' in opts ? opts.sync : false; | |
2979 return dart.notNull(sync) ? new (_SyncBroadcastStreamController$(T))(onL
isten, onCancel) : new (_AsyncBroadcastStreamController$(T))(onListen, onCancel)
; | 2950 return dart.notNull(sync) ? new (_SyncBroadcastStreamController$(T))(onL
isten, onCancel) : new (_AsyncBroadcastStreamController$(T))(onListen, onCancel)
; |
2980 } | 2951 } |
2981 } | 2952 } |
2982 StreamController[dart.implements] = () => [StreamSink$(T)]; | 2953 StreamController[dart.implements] = () => [StreamSink$(T)]; |
2983 dart.setSignature(StreamController, { | 2954 dart.setSignature(StreamController, { |
2984 constructors: () => ({ | 2955 constructors: () => ({ |
2985 new: [StreamController$(T), [], {onListen: dart.functionType(dart.void,
[]), onPause: dart.functionType(dart.void, []), onResume: dart.functionType(dart
.void, []), onCancel: dart.functionType(dart.dynamic, []), sync: core.bool}], | 2956 new: [StreamController$(T), [], {onListen: dart.functionType(dart.void,
[]), onPause: dart.functionType(dart.void, []), onResume: dart.functionType(dart
.void, []), onCancel: dart.functionType(dart.dynamic, []), sync: core.bool}], |
2986 broadcast: [StreamController$(T), [], {onListen: dart.functionType(dart.
void, []), onCancel: dart.functionType(dart.void, []), sync: core.bool}] | 2957 broadcast: [StreamController$(T), [], {onListen: dart.functionType(dart.
void, []), onCancel: dart.functionType(dart.void, []), sync: core.bool}] |
2987 }) | 2958 }) |
2988 }); | 2959 }); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3080 } | 3051 } |
3081 return dart.as(this[_varData], _ControllerSubscription); | 3052 return dart.as(this[_varData], _ControllerSubscription); |
3082 } | 3053 } |
3083 [_badEventState]() { | 3054 [_badEventState]() { |
3084 if (dart.notNull(this.isClosed)) { | 3055 if (dart.notNull(this.isClosed)) { |
3085 return new core.StateError("Cannot add event after closing"); | 3056 return new core.StateError("Cannot add event after closing"); |
3086 } | 3057 } |
3087 dart.assert(this[_isAddingStream]); | 3058 dart.assert(this[_isAddingStream]); |
3088 return new core.StateError("Cannot add event while adding a stream"); | 3059 return new core.StateError("Cannot add event while adding a stream"); |
3089 } | 3060 } |
3090 addStream(source, opts) { | 3061 addStream(source, {cancelOnError = true} = {}) { |
3091 dart.as(source, Stream$(T)); | 3062 dart.as(source, Stream$(T)); |
3092 let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError
: true; | |
3093 if (!dart.notNull(this[_mayAddEvent])) | 3063 if (!dart.notNull(this[_mayAddEvent])) |
3094 dart.throw(this[_badEventState]()); | 3064 dart.throw(this[_badEventState]()); |
3095 if (dart.notNull(this[_isCanceled])) | 3065 if (dart.notNull(this[_isCanceled])) |
3096 return new _Future.immediate(null); | 3066 return new _Future.immediate(null); |
3097 let addState = new _StreamControllerAddStreamState(this, this[_varData],
source, cancelOnError); | 3067 let addState = new _StreamControllerAddStreamState(this, this[_varData],
source, cancelOnError); |
3098 this[_varData] = addState; | 3068 this[_varData] = addState; |
3099 this[_state] = dart.notNull(this[_state]) | dart.notNull(_StreamControll
er$()._STATE_ADDSTREAM); | 3069 this[_state] = dart.notNull(this[_state]) | dart.notNull(_StreamControll
er$()._STATE_ADDSTREAM); |
3100 return addState.addStreamFuture; | 3070 return addState.addStreamFuture; |
3101 } | 3071 } |
3102 get done() { | 3072 get done() { |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3402 this[_target].add(data); | 3372 this[_target].add(data); |
3403 } | 3373 } |
3404 addError(error, stackTrace) { | 3374 addError(error, stackTrace) { |
3405 if (stackTrace === void 0) | 3375 if (stackTrace === void 0) |
3406 stackTrace = null; | 3376 stackTrace = null; |
3407 this[_target].addError(error, stackTrace); | 3377 this[_target].addError(error, stackTrace); |
3408 } | 3378 } |
3409 close() { | 3379 close() { |
3410 return this[_target].close(); | 3380 return this[_target].close(); |
3411 } | 3381 } |
3412 addStream(source, opts) { | 3382 addStream(source, {cancelOnError = true} = {}) { |
3413 dart.as(source, Stream$(T)); | 3383 dart.as(source, Stream$(T)); |
3414 let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError
: true; | |
3415 return this[_target].addStream(source, {cancelOnError: cancelOnError}); | 3384 return this[_target].addStream(source, {cancelOnError: cancelOnError}); |
3416 } | 3385 } |
3417 get done() { | 3386 get done() { |
3418 return this[_target].done; | 3387 return this[_target].done; |
3419 } | 3388 } |
3420 } | 3389 } |
3421 _StreamSinkWrapper[dart.implements] = () => [StreamSink$(T)]; | 3390 _StreamSinkWrapper[dart.implements] = () => [StreamSink$(T)]; |
3422 dart.setSignature(_StreamSinkWrapper, { | 3391 dart.setSignature(_StreamSinkWrapper, { |
3423 constructors: () => ({_StreamSinkWrapper: [_StreamSinkWrapper$(T), [Stream
Controller]]}), | 3392 constructors: () => ({_StreamSinkWrapper: [_StreamSinkWrapper$(T), [Stream
Controller]]}), |
3424 methods: () => ({ | 3393 methods: () => ({ |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3878 this[_onCancelHandler] = dart.as(Zone.current.registerUnaryCallback(onCa
ncelHandler), _broadcastCallback); | 3847 this[_onCancelHandler] = dart.as(Zone.current.registerUnaryCallback(onCa
ncelHandler), _broadcastCallback); |
3879 this[_zone] = Zone.current; | 3848 this[_zone] = Zone.current; |
3880 this[_controller] = null; | 3849 this[_controller] = null; |
3881 this[_subscription] = null; | 3850 this[_subscription] = null; |
3882 super.Stream(); | 3851 super.Stream(); |
3883 this[_controller] = new (_AsBroadcastStreamController$(T))(dart.bind(thi
s, _onListen), dart.bind(this, _onCancel)); | 3852 this[_controller] = new (_AsBroadcastStreamController$(T))(dart.bind(thi
s, _onListen), dart.bind(this, _onCancel)); |
3884 } | 3853 } |
3885 get isBroadcast() { | 3854 get isBroadcast() { |
3886 return true; | 3855 return true; |
3887 } | 3856 } |
3888 listen(onData, opts) { | 3857 listen(onData, {onError = null, onDone = null, cancelOnError = null} = {})
{ |
3889 dart.as(onData, dart.functionType(dart.void, [T])); | 3858 dart.as(onData, dart.functionType(dart.void, [T])); |
3890 let onError = opts && 'onError' in opts ? opts.onError : null; | |
3891 let onDone = opts && 'onDone' in opts ? opts.onDone : null; | |
3892 dart.as(onDone, dart.functionType(dart.void, [])); | 3859 dart.as(onDone, dart.functionType(dart.void, [])); |
3893 let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError
: null; | |
3894 if (this[_controller] == null || dart.notNull(this[_controller].isClosed
)) { | 3860 if (this[_controller] == null || dart.notNull(this[_controller].isClosed
)) { |
3895 return new (_DoneStreamSubscription$(T))(onDone); | 3861 return new (_DoneStreamSubscription$(T))(onDone); |
3896 } | 3862 } |
3897 if (this[_subscription] == null) { | 3863 if (this[_subscription] == null) { |
3898 this[_subscription] = this[_source].listen(dart.bind(this[_controller]
, 'add'), {onError: dart.bind(this[_controller], 'addError'), onDone: dart.bind(
this[_controller], 'close')}); | 3864 this[_subscription] = this[_source].listen(dart.bind(this[_controller]
, 'add'), {onError: dart.bind(this[_controller], 'addError'), onDone: dart.bind(
this[_controller], 'close')}); |
3899 } | 3865 } |
3900 cancelOnError = core.identical(true, cancelOnError); | 3866 cancelOnError = core.identical(true, cancelOnError); |
3901 return this[_controller][_subscribe](onData, onError, onDone, cancelOnEr
ror); | 3867 return this[_controller][_subscribe](onData, onError, onDone, cancelOnEr
ror); |
3902 } | 3868 } |
3903 [_onCancel]() { | 3869 [_onCancel]() { |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4201 const _handleDone = Symbol('_handleDone'); | 4167 const _handleDone = Symbol('_handleDone'); |
4202 const _ForwardingStream$ = dart.generic(function(S, T) { | 4168 const _ForwardingStream$ = dart.generic(function(S, T) { |
4203 class _ForwardingStream extends Stream$(T) { | 4169 class _ForwardingStream extends Stream$(T) { |
4204 _ForwardingStream(source) { | 4170 _ForwardingStream(source) { |
4205 this[_source] = source; | 4171 this[_source] = source; |
4206 super.Stream(); | 4172 super.Stream(); |
4207 } | 4173 } |
4208 get isBroadcast() { | 4174 get isBroadcast() { |
4209 return this[_source].isBroadcast; | 4175 return this[_source].isBroadcast; |
4210 } | 4176 } |
4211 listen(onData, opts) { | 4177 listen(onData, {onError = null, onDone = null, cancelOnError = null} = {})
{ |
4212 dart.as(onData, dart.functionType(dart.void, [T])); | 4178 dart.as(onData, dart.functionType(dart.void, [T])); |
4213 let onError = opts && 'onError' in opts ? opts.onError : null; | |
4214 let onDone = opts && 'onDone' in opts ? opts.onDone : null; | |
4215 dart.as(onDone, dart.functionType(dart.void, [])); | 4179 dart.as(onDone, dart.functionType(dart.void, [])); |
4216 let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError
: null; | |
4217 cancelOnError = core.identical(true, cancelOnError); | 4180 cancelOnError = core.identical(true, cancelOnError); |
4218 return this[_createSubscription](onData, onError, onDone, cancelOnError)
; | 4181 return this[_createSubscription](onData, onError, onDone, cancelOnError)
; |
4219 } | 4182 } |
4220 [_createSubscription](onData, onError, onDone, cancelOnError) { | 4183 [_createSubscription](onData, onError, onDone, cancelOnError) { |
4221 dart.as(onData, dart.functionType(dart.void, [T])); | 4184 dart.as(onData, dart.functionType(dart.void, [T])); |
4222 dart.as(onDone, dart.functionType(dart.void, [])); | 4185 dart.as(onDone, dart.functionType(dart.void, [])); |
4223 return new (_ForwardingStreamSubscription$(S, T))(this, onData, onError,
onDone, cancelOnError); | 4186 return new (_ForwardingStreamSubscription$(S, T))(this, onData, onError,
onDone, cancelOnError); |
4224 } | 4187 } |
4225 [_handleData](data, sink) { | 4188 [_handleData](data, sink) { |
4226 dart.as(data, S); | 4189 dart.as(data, S); |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4795 const _BoundSinkStream$ = dart.generic(function(S, T) { | 4758 const _BoundSinkStream$ = dart.generic(function(S, T) { |
4796 class _BoundSinkStream extends Stream$(T) { | 4759 class _BoundSinkStream extends Stream$(T) { |
4797 get isBroadcast() { | 4760 get isBroadcast() { |
4798 return this[_stream].isBroadcast; | 4761 return this[_stream].isBroadcast; |
4799 } | 4762 } |
4800 _BoundSinkStream(stream, sinkMapper) { | 4763 _BoundSinkStream(stream, sinkMapper) { |
4801 this[_stream] = stream; | 4764 this[_stream] = stream; |
4802 this[_sinkMapper] = sinkMapper; | 4765 this[_sinkMapper] = sinkMapper; |
4803 super.Stream(); | 4766 super.Stream(); |
4804 } | 4767 } |
4805 listen(onData, opts) { | 4768 listen(onData, {onError = null, onDone = null, cancelOnError = null} = {})
{ |
4806 dart.as(onData, dart.functionType(dart.void, [T])); | 4769 dart.as(onData, dart.functionType(dart.void, [T])); |
4807 let onError = opts && 'onError' in opts ? opts.onError : null; | |
4808 let onDone = opts && 'onDone' in opts ? opts.onDone : null; | |
4809 dart.as(onDone, dart.functionType(dart.void, [])); | 4770 dart.as(onDone, dart.functionType(dart.void, [])); |
4810 let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError
: null; | |
4811 cancelOnError = core.identical(true, cancelOnError); | 4771 cancelOnError = core.identical(true, cancelOnError); |
4812 let subscription = new (_SinkTransformerStreamSubscription$(dart.dynamic
, T))(this[_stream], dart.as(this[_sinkMapper], _SinkMapper), onData, onError, o
nDone, cancelOnError); | 4772 let subscription = new (_SinkTransformerStreamSubscription$(dart.dynamic
, T))(this[_stream], dart.as(this[_sinkMapper], _SinkMapper), onData, onError, o
nDone, cancelOnError); |
4813 return subscription; | 4773 return subscription; |
4814 } | 4774 } |
4815 } | 4775 } |
4816 dart.setSignature(_BoundSinkStream, { | 4776 dart.setSignature(_BoundSinkStream, { |
4817 constructors: () => ({_BoundSinkStream: [_BoundSinkStream$(S, T), [Stream$
(S), _SinkMapper$(S, T)]]}), | 4777 constructors: () => ({_BoundSinkStream: [_BoundSinkStream$(S, T), [Stream$
(S), _SinkMapper$(S, T)]]}), |
4818 methods: () => ({listen: [StreamSubscription$(T), [dart.functionType(dart.
void, [T])], {onError: core.Function, onDone: dart.functionType(dart.void, []),
cancelOnError: core.bool}]}) | 4778 methods: () => ({listen: [StreamSubscription$(T), [dart.functionType(dart.
void, [T])], {onError: core.Function, onDone: dart.functionType(dart.void, []),
cancelOnError: core.bool}]}) |
4819 }); | 4779 }); |
4820 return _BoundSinkStream; | 4780 return _BoundSinkStream; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4863 add: [dart.void, [S]], | 4823 add: [dart.void, [S]], |
4864 addError: [dart.void, [core.Object], [core.StackTrace]], | 4824 addError: [dart.void, [core.Object], [core.StackTrace]], |
4865 close: [dart.void, []] | 4825 close: [dart.void, []] |
4866 }) | 4826 }) |
4867 }); | 4827 }); |
4868 return _HandlerEventSink; | 4828 return _HandlerEventSink; |
4869 }); | 4829 }); |
4870 let _HandlerEventSink = _HandlerEventSink$(); | 4830 let _HandlerEventSink = _HandlerEventSink$(); |
4871 const _StreamHandlerTransformer$ = dart.generic(function(S, T) { | 4831 const _StreamHandlerTransformer$ = dart.generic(function(S, T) { |
4872 class _StreamHandlerTransformer extends _StreamSinkTransformer$(S, T) { | 4832 class _StreamHandlerTransformer extends _StreamSinkTransformer$(S, T) { |
4873 _StreamHandlerTransformer(opts) { | 4833 _StreamHandlerTransformer({handleData = null, handleError = null, handleDo
ne = null} = {}) { |
4874 let handleData = opts && 'handleData' in opts ? opts.handleData : null; | |
4875 let handleError = opts && 'handleError' in opts ? opts.handleError : nul
l; | |
4876 let handleDone = opts && 'handleDone' in opts ? opts.handleDone : null; | |
4877 super._StreamSinkTransformer(dart.as(dart.fn(outputSink => { | 4834 super._StreamSinkTransformer(dart.as(dart.fn(outputSink => { |
4878 dart.as(outputSink, EventSink$(T)); | 4835 dart.as(outputSink, EventSink$(T)); |
4879 if (handleData == null) | 4836 if (handleData == null) |
4880 handleData = dart.as(_StreamHandlerTransformer$()._defaultHandleData
, __CastType27$(S, T)); | 4837 handleData = dart.as(_StreamHandlerTransformer$()._defaultHandleData
, __CastType27$(S, T)); |
4881 if (handleError == null) | 4838 if (handleError == null) |
4882 handleError = dart.as(_StreamHandlerTransformer$()._defaultHandleErr
or, __CastType30$(T)); | 4839 handleError = dart.as(_StreamHandlerTransformer$()._defaultHandleErr
or, __CastType30$(T)); |
4883 if (handleDone == null) | 4840 if (handleDone == null) |
4884 handleDone = _StreamHandlerTransformer$()._defaultHandleDone; | 4841 handleDone = _StreamHandlerTransformer$()._defaultHandleDone; |
4885 return new (_HandlerEventSink$(S, T))(handleData, handleError, handleD
one, outputSink); | 4842 return new (_HandlerEventSink$(S, T))(handleData, handleError, handleD
one, outputSink); |
4886 }, dart.dynamic, [EventSink$(T)]), _SinkMapper$(S, T))); | 4843 }, dart.dynamic, [EventSink$(T)]), _SinkMapper$(S, T))); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4936 return _StreamSubscriptionTransformer; | 4893 return _StreamSubscriptionTransformer; |
4937 }); | 4894 }); |
4938 let _StreamSubscriptionTransformer = _StreamSubscriptionTransformer$(); | 4895 let _StreamSubscriptionTransformer = _StreamSubscriptionTransformer$(); |
4939 const _BoundSubscriptionStream$ = dart.generic(function(S, T) { | 4896 const _BoundSubscriptionStream$ = dart.generic(function(S, T) { |
4940 class _BoundSubscriptionStream extends Stream$(T) { | 4897 class _BoundSubscriptionStream extends Stream$(T) { |
4941 _BoundSubscriptionStream(stream, transformer) { | 4898 _BoundSubscriptionStream(stream, transformer) { |
4942 this[_stream] = stream; | 4899 this[_stream] = stream; |
4943 this[_transformer] = transformer; | 4900 this[_transformer] = transformer; |
4944 super.Stream(); | 4901 super.Stream(); |
4945 } | 4902 } |
4946 listen(onData, opts) { | 4903 listen(onData, {onError = null, onDone = null, cancelOnError = null} = {})
{ |
4947 dart.as(onData, dart.functionType(dart.void, [T])); | 4904 dart.as(onData, dart.functionType(dart.void, [T])); |
4948 let onError = opts && 'onError' in opts ? opts.onError : null; | |
4949 let onDone = opts && 'onDone' in opts ? opts.onDone : null; | |
4950 dart.as(onDone, dart.functionType(dart.void, [])); | 4905 dart.as(onDone, dart.functionType(dart.void, [])); |
4951 let cancelOnError = opts && 'cancelOnError' in opts ? opts.cancelOnError
: null; | |
4952 cancelOnError = core.identical(true, cancelOnError); | 4906 cancelOnError = core.identical(true, cancelOnError); |
4953 let result = this[_transformer](this[_stream], cancelOnError); | 4907 let result = this[_transformer](this[_stream], cancelOnError); |
4954 result.onData(onData); | 4908 result.onData(onData); |
4955 result.onError(onError); | 4909 result.onError(onError); |
4956 result.onDone(onDone); | 4910 result.onDone(onDone); |
4957 return result; | 4911 return result; |
4958 } | 4912 } |
4959 } | 4913 } |
4960 dart.setSignature(_BoundSubscriptionStream, { | 4914 dart.setSignature(_BoundSubscriptionStream, { |
4961 constructors: () => ({_BoundSubscriptionStream: [_BoundSubscriptionStream$
(S, T), [Stream$(S), _SubscriptionTransformer$(S, T)]]}), | 4915 constructors: () => ({_BoundSubscriptionStream: [_BoundSubscriptionStream$
(S, T), [Stream$(S), _SubscriptionTransformer$(S, T)]]}), |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5038 this.function = func; | 4992 this.function = func; |
5039 } | 4993 } |
5040 } | 4994 } |
5041 dart.setSignature(_ZoneFunction, { | 4995 dart.setSignature(_ZoneFunction, { |
5042 constructors: () => ({_ZoneFunction: [_ZoneFunction, [_Zone, core.Function]]
}) | 4996 constructors: () => ({_ZoneFunction: [_ZoneFunction, [_Zone, core.Function]]
}) |
5043 }); | 4997 }); |
5044 class ZoneSpecification extends core.Object { | 4998 class ZoneSpecification extends core.Object { |
5045 static new(opts) { | 4999 static new(opts) { |
5046 return new _ZoneSpecification(opts); | 5000 return new _ZoneSpecification(opts); |
5047 } | 5001 } |
5048 static from(other, opts) { | 5002 static from(other, {handleUncaughtError = null, run = null, runUnary = null,
runBinary = null, registerCallback = null, registerUnaryCallback = null, regist
erBinaryCallback = null, errorCallback = null, scheduleMicrotask = null, createT
imer = null, createPeriodicTimer = null, print = null, fork = null} = {}) { |
5049 let handleUncaughtError = opts && 'handleUncaughtError' in opts ? opts.han
dleUncaughtError : null; | |
5050 let run = opts && 'run' in opts ? opts.run : null; | |
5051 let runUnary = opts && 'runUnary' in opts ? opts.runUnary : null; | |
5052 let runBinary = opts && 'runBinary' in opts ? opts.runBinary : null; | |
5053 let registerCallback = opts && 'registerCallback' in opts ? opts.registerC
allback : null; | |
5054 let registerUnaryCallback = opts && 'registerUnaryCallback' in opts ? opts
.registerUnaryCallback : null; | |
5055 let registerBinaryCallback = opts && 'registerBinaryCallback' in opts ? op
ts.registerBinaryCallback : null; | |
5056 let errorCallback = opts && 'errorCallback' in opts ? opts.errorCallback :
null; | |
5057 let scheduleMicrotask = opts && 'scheduleMicrotask' in opts ? opts.schedul
eMicrotask : null; | |
5058 let createTimer = opts && 'createTimer' in opts ? opts.createTimer : null; | |
5059 let createPeriodicTimer = opts && 'createPeriodicTimer' in opts ? opts.cre
atePeriodicTimer : null; | |
5060 let print = opts && 'print' in opts ? opts.print : null; | |
5061 let fork = opts && 'fork' in opts ? opts.fork : null; | |
5062 return ZoneSpecification.new({handleUncaughtError: handleUncaughtError !=
null ? handleUncaughtError : other.handleUncaughtError, run: run != null ? run :
other.run, runUnary: runUnary != null ? runUnary : other.runUnary, runBinary: r
unBinary != null ? runBinary : other.runBinary, registerCallback: registerCallba
ck != null ? registerCallback : other.registerCallback, registerUnaryCallback: r
egisterUnaryCallback != null ? registerUnaryCallback : other.registerUnaryCallba
ck, registerBinaryCallback: registerBinaryCallback != null ? registerBinaryCallb
ack : other.registerBinaryCallback, errorCallback: errorCallback != null ? error
Callback : other.errorCallback, scheduleMicrotask: scheduleMicrotask != null ? s
cheduleMicrotask : other.scheduleMicrotask, createTimer: createTimer != null ? c
reateTimer : other.createTimer, createPeriodicTimer: createPeriodicTimer != null
? createPeriodicTimer : other.createPeriodicTimer, print: print != null ? print
: other.print, fork: fork != null ? fork : other.fork}); | 5003 return ZoneSpecification.new({handleUncaughtError: handleUncaughtError !=
null ? handleUncaughtError : other.handleUncaughtError, run: run != null ? run :
other.run, runUnary: runUnary != null ? runUnary : other.runUnary, runBinary: r
unBinary != null ? runBinary : other.runBinary, registerCallback: registerCallba
ck != null ? registerCallback : other.registerCallback, registerUnaryCallback: r
egisterUnaryCallback != null ? registerUnaryCallback : other.registerUnaryCallba
ck, registerBinaryCallback: registerBinaryCallback != null ? registerBinaryCallb
ack : other.registerBinaryCallback, errorCallback: errorCallback != null ? error
Callback : other.errorCallback, scheduleMicrotask: scheduleMicrotask != null ? s
cheduleMicrotask : other.scheduleMicrotask, createTimer: createTimer != null ? c
reateTimer : other.createTimer, createPeriodicTimer: createPeriodicTimer != null
? createPeriodicTimer : other.createPeriodicTimer, print: print != null ? print
: other.print, fork: fork != null ? fork : other.fork}); |
5063 } | 5004 } |
5064 } | 5005 } |
5065 dart.setSignature(ZoneSpecification, { | 5006 dart.setSignature(ZoneSpecification, { |
5066 constructors: () => ({ | 5007 constructors: () => ({ |
5067 new: [ZoneSpecification, [], {handleUncaughtError: dart.functionType(dart.
dynamic, [Zone, ZoneDelegate, Zone, dart.dynamic, core.StackTrace]), run: dart.f
unctionType(dart.dynamic, [Zone, ZoneDelegate, Zone, dart.functionType(dart.dyna
mic, [])]), runUnary: dart.functionType(dart.dynamic, [Zone, ZoneDelegate, Zone,
dart.functionType(dart.dynamic, [dart.dynamic]), dart.dynamic]), runBinary: dar
t.functionType(dart.dynamic, [Zone, ZoneDelegate, Zone, dart.functionType(dart.d
ynamic, [dart.dynamic, dart.dynamic]), dart.dynamic, dart.dynamic]), registerCal
lback: dart.functionType(ZoneCallback, [Zone, ZoneDelegate, Zone, dart.functionT
ype(dart.dynamic, [])]), registerUnaryCallback: dart.functionType(ZoneUnaryCallb
ack, [Zone, ZoneDelegate, Zone, dart.functionType(dart.dynamic, [dart.dynamic])]
), registerBinaryCallback: dart.functionType(ZoneBinaryCallback, [Zone, ZoneDele
gate, Zone, dart.functionType(dart.dynamic, [dart.dynamic, dart.dynamic])]), err
orCallback: dart.functionType(AsyncError, [Zone, ZoneDelegate, Zone, core.Object
, core.StackTrace]), scheduleMicrotask: dart.functionType(dart.void, [Zone, Zone
Delegate, Zone, dart.functionType(dart.dynamic, [])]), createTimer: dart.functio
nType(Timer, [Zone, ZoneDelegate, Zone, core.Duration, dart.functionType(dart.vo
id, [])]), createPeriodicTimer: dart.functionType(Timer, [Zone, ZoneDelegate, Zo
ne, core.Duration, dart.functionType(dart.void, [Timer])]), print: dart.function
Type(dart.void, [Zone, ZoneDelegate, Zone, core.String]), fork: dart.functionTyp
e(Zone, [Zone, ZoneDelegate, Zone, ZoneSpecification, core.Map])}], | 5008 new: [ZoneSpecification, [], {handleUncaughtError: dart.functionType(dart.
dynamic, [Zone, ZoneDelegate, Zone, dart.dynamic, core.StackTrace]), run: dart.f
unctionType(dart.dynamic, [Zone, ZoneDelegate, Zone, dart.functionType(dart.dyna
mic, [])]), runUnary: dart.functionType(dart.dynamic, [Zone, ZoneDelegate, Zone,
dart.functionType(dart.dynamic, [dart.dynamic]), dart.dynamic]), runBinary: dar
t.functionType(dart.dynamic, [Zone, ZoneDelegate, Zone, dart.functionType(dart.d
ynamic, [dart.dynamic, dart.dynamic]), dart.dynamic, dart.dynamic]), registerCal
lback: dart.functionType(ZoneCallback, [Zone, ZoneDelegate, Zone, dart.functionT
ype(dart.dynamic, [])]), registerUnaryCallback: dart.functionType(ZoneUnaryCallb
ack, [Zone, ZoneDelegate, Zone, dart.functionType(dart.dynamic, [dart.dynamic])]
), registerBinaryCallback: dart.functionType(ZoneBinaryCallback, [Zone, ZoneDele
gate, Zone, dart.functionType(dart.dynamic, [dart.dynamic, dart.dynamic])]), err
orCallback: dart.functionType(AsyncError, [Zone, ZoneDelegate, Zone, core.Object
, core.StackTrace]), scheduleMicrotask: dart.functionType(dart.void, [Zone, Zone
Delegate, Zone, dart.functionType(dart.dynamic, [])]), createTimer: dart.functio
nType(Timer, [Zone, ZoneDelegate, Zone, core.Duration, dart.functionType(dart.vo
id, [])]), createPeriodicTimer: dart.functionType(Timer, [Zone, ZoneDelegate, Zo
ne, core.Duration, dart.functionType(dart.void, [Timer])]), print: dart.function
Type(dart.void, [Zone, ZoneDelegate, Zone, core.String]), fork: dart.functionTyp
e(Zone, [Zone, ZoneDelegate, Zone, ZoneSpecification, core.Map])}], |
5068 from: [ZoneSpecification, [ZoneSpecification], {handleUncaughtError: dart.
functionType(dart.dynamic, [Zone, ZoneDelegate, Zone, dart.dynamic, core.StackTr
ace]), run: dart.functionType(dart.dynamic, [Zone, ZoneDelegate, Zone, dart.func
tionType(dart.dynamic, [])]), runUnary: dart.functionType(dart.dynamic, [Zone, Z
oneDelegate, Zone, dart.functionType(dart.dynamic, [dart.dynamic]), dart.dynamic
]), runBinary: dart.functionType(dart.dynamic, [Zone, ZoneDelegate, Zone, dart.f
unctionType(dart.dynamic, [dart.dynamic, dart.dynamic]), dart.dynamic, dart.dyna
mic]), registerCallback: dart.functionType(ZoneCallback, [Zone, ZoneDelegate, Zo
ne, dart.functionType(dart.dynamic, [])]), registerUnaryCallback: dart.functionT
ype(ZoneUnaryCallback, [Zone, ZoneDelegate, Zone, dart.functionType(dart.dynamic
, [dart.dynamic])]), registerBinaryCallback: dart.functionType(ZoneBinaryCallbac
k, [Zone, ZoneDelegate, Zone, dart.functionType(dart.dynamic, [dart.dynamic, dar
t.dynamic])]), errorCallback: dart.functionType(AsyncError, [Zone, ZoneDelegate,
Zone, core.Object, core.StackTrace]), scheduleMicrotask: dart.functionType(dart
.void, [Zone, ZoneDelegate, Zone, dart.functionType(dart.dynamic, [])]), createT
imer: dart.functionType(Timer, [Zone, ZoneDelegate, Zone, core.Duration, dart.fu
nctionType(dart.void, [])]), createPeriodicTimer: dart.functionType(Timer, [Zone
, ZoneDelegate, Zone, core.Duration, dart.functionType(dart.void, [Timer])]), pr
int: dart.functionType(dart.void, [Zone, ZoneDelegate, Zone, core.String]), fork
: dart.functionType(Zone, [Zone, ZoneDelegate, Zone, ZoneSpecification, core.Map
])}] | 5009 from: [ZoneSpecification, [ZoneSpecification], {handleUncaughtError: dart.
functionType(dart.dynamic, [Zone, ZoneDelegate, Zone, dart.dynamic, core.StackTr
ace]), run: dart.functionType(dart.dynamic, [Zone, ZoneDelegate, Zone, dart.func
tionType(dart.dynamic, [])]), runUnary: dart.functionType(dart.dynamic, [Zone, Z
oneDelegate, Zone, dart.functionType(dart.dynamic, [dart.dynamic]), dart.dynamic
]), runBinary: dart.functionType(dart.dynamic, [Zone, ZoneDelegate, Zone, dart.f
unctionType(dart.dynamic, [dart.dynamic, dart.dynamic]), dart.dynamic, dart.dyna
mic]), registerCallback: dart.functionType(ZoneCallback, [Zone, ZoneDelegate, Zo
ne, dart.functionType(dart.dynamic, [])]), registerUnaryCallback: dart.functionT
ype(ZoneUnaryCallback, [Zone, ZoneDelegate, Zone, dart.functionType(dart.dynamic
, [dart.dynamic])]), registerBinaryCallback: dart.functionType(ZoneBinaryCallbac
k, [Zone, ZoneDelegate, Zone, dart.functionType(dart.dynamic, [dart.dynamic, dar
t.dynamic])]), errorCallback: dart.functionType(AsyncError, [Zone, ZoneDelegate,
Zone, core.Object, core.StackTrace]), scheduleMicrotask: dart.functionType(dart
.void, [Zone, ZoneDelegate, Zone, dart.functionType(dart.dynamic, [])]), createT
imer: dart.functionType(Timer, [Zone, ZoneDelegate, Zone, core.Duration, dart.fu
nctionType(dart.void, [])]), createPeriodicTimer: dart.functionType(Timer, [Zone
, ZoneDelegate, Zone, core.Duration, dart.functionType(dart.void, [Timer])]), pr
int: dart.functionType(dart.void, [Zone, ZoneDelegate, Zone, core.String]), fork
: dart.functionType(Zone, [Zone, ZoneDelegate, Zone, ZoneSpecification, core.Map
])}] |
5069 }) | 5010 }) |
5070 }); | 5011 }); |
5071 class _ZoneSpecification extends core.Object { | 5012 class _ZoneSpecification extends core.Object { |
5072 _ZoneSpecification(opts) { | 5013 _ZoneSpecification({handleUncaughtError = null, run = null, runUnary = null,
runBinary = null, registerCallback = null, registerUnaryCallback = null, regist
erBinaryCallback = null, errorCallback = null, scheduleMicrotask = null, createT
imer = null, createPeriodicTimer = null, print = null, fork = null} = {}) { |
5073 let handleUncaughtError = opts && 'handleUncaughtError' in opts ? opts.han
dleUncaughtError : null; | |
5074 let run = opts && 'run' in opts ? opts.run : null; | |
5075 let runUnary = opts && 'runUnary' in opts ? opts.runUnary : null; | |
5076 let runBinary = opts && 'runBinary' in opts ? opts.runBinary : null; | |
5077 let registerCallback = opts && 'registerCallback' in opts ? opts.registerC
allback : null; | |
5078 let registerUnaryCallback = opts && 'registerUnaryCallback' in opts ? opts
.registerUnaryCallback : null; | |
5079 let registerBinaryCallback = opts && 'registerBinaryCallback' in opts ? op
ts.registerBinaryCallback : null; | |
5080 let errorCallback = opts && 'errorCallback' in opts ? opts.errorCallback :
null; | |
5081 let scheduleMicrotask = opts && 'scheduleMicrotask' in opts ? opts.schedul
eMicrotask : null; | |
5082 let createTimer = opts && 'createTimer' in opts ? opts.createTimer : null; | |
5083 let createPeriodicTimer = opts && 'createPeriodicTimer' in opts ? opts.cre
atePeriodicTimer : null; | |
5084 let print = opts && 'print' in opts ? opts.print : null; | |
5085 let fork = opts && 'fork' in opts ? opts.fork : null; | |
5086 this.handleUncaughtError = handleUncaughtError; | 5014 this.handleUncaughtError = handleUncaughtError; |
5087 this.run = run; | 5015 this.run = run; |
5088 this.runUnary = runUnary; | 5016 this.runUnary = runUnary; |
5089 this.runBinary = runBinary; | 5017 this.runBinary = runBinary; |
5090 this.registerCallback = registerCallback; | 5018 this.registerCallback = registerCallback; |
5091 this.registerUnaryCallback = registerUnaryCallback; | 5019 this.registerUnaryCallback = registerUnaryCallback; |
5092 this.registerBinaryCallback = registerBinaryCallback; | 5020 this.registerBinaryCallback = registerBinaryCallback; |
5093 this.errorCallback = errorCallback; | 5021 this.errorCallback = errorCallback; |
5094 this.scheduleMicrotask = scheduleMicrotask; | 5022 this.scheduleMicrotask = scheduleMicrotask; |
5095 this.createTimer = createTimer; | 5023 this.createTimer = createTimer; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5243 if (dart.notNull(core.identical(_ROOT_ZONE, Zone._current))) { | 5171 if (dart.notNull(core.identical(_ROOT_ZONE, Zone._current))) { |
5244 return dart.dcall(f, arg1, arg2); | 5172 return dart.dcall(f, arg1, arg2); |
5245 } | 5173 } |
5246 return _rootRunBinary(null, null, this, f, arg1, arg2); | 5174 return _rootRunBinary(null, null, this, f, arg1, arg2); |
5247 } catch (e) { | 5175 } catch (e) { |
5248 let s = dart.stackTrace(e); | 5176 let s = dart.stackTrace(e); |
5249 return this.handleUncaughtError(e, s); | 5177 return this.handleUncaughtError(e, s); |
5250 } | 5178 } |
5251 | 5179 |
5252 } | 5180 } |
5253 bindCallback(f, opts) { | 5181 bindCallback(f, {runGuarded = true} = {}) { |
5254 let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true; | |
5255 if (dart.notNull(runGuarded)) { | 5182 if (dart.notNull(runGuarded)) { |
5256 return dart.fn((() => this.runGuarded(f)).bind(this)); | 5183 return dart.fn((() => this.runGuarded(f)).bind(this)); |
5257 } else { | 5184 } else { |
5258 return dart.fn((() => this.run(f)).bind(this)); | 5185 return dart.fn((() => this.run(f)).bind(this)); |
5259 } | 5186 } |
5260 } | 5187 } |
5261 bindUnaryCallback(f, opts) { | 5188 bindUnaryCallback(f, {runGuarded = true} = {}) { |
5262 let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true; | |
5263 if (dart.notNull(runGuarded)) { | 5189 if (dart.notNull(runGuarded)) { |
5264 return dart.fn((arg => this.runUnaryGuarded(f, arg)).bind(this)); | 5190 return dart.fn((arg => this.runUnaryGuarded(f, arg)).bind(this)); |
5265 } else { | 5191 } else { |
5266 return dart.fn((arg => this.runUnary(f, arg)).bind(this)); | 5192 return dart.fn((arg => this.runUnary(f, arg)).bind(this)); |
5267 } | 5193 } |
5268 } | 5194 } |
5269 bindBinaryCallback(f, opts) { | 5195 bindBinaryCallback(f, {runGuarded = true} = {}) { |
5270 let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true; | |
5271 if (dart.notNull(runGuarded)) { | 5196 if (dart.notNull(runGuarded)) { |
5272 return dart.fn(((arg1, arg2) => this.runBinaryGuarded(f, arg1, arg2)).bi
nd(this)); | 5197 return dart.fn(((arg1, arg2) => this.runBinaryGuarded(f, arg1, arg2)).bi
nd(this)); |
5273 } else { | 5198 } else { |
5274 return dart.fn(((arg1, arg2) => this.runBinary(f, arg1, arg2)).bind(this
)); | 5199 return dart.fn(((arg1, arg2) => this.runBinary(f, arg1, arg2)).bind(this
)); |
5275 } | 5200 } |
5276 } | 5201 } |
5277 get(key) { | 5202 get(key) { |
5278 return null; | 5203 return null; |
5279 } | 5204 } |
5280 handleUncaughtError(error, stackTrace) { | 5205 handleUncaughtError(error, stackTrace) { |
5281 return _rootHandleUncaughtError(null, null, this, error, stackTrace); | 5206 return _rootHandleUncaughtError(null, null, this, error, stackTrace); |
5282 } | 5207 } |
5283 fork(opts) { | 5208 fork({specification = null, zoneValues = null} = {}) { |
5284 let specification = opts && 'specification' in opts ? opts.specification :
null; | |
5285 let zoneValues = opts && 'zoneValues' in opts ? opts.zoneValues : null; | |
5286 return _rootFork(null, null, this, specification, zoneValues); | 5209 return _rootFork(null, null, this, specification, zoneValues); |
5287 } | 5210 } |
5288 run(f) { | 5211 run(f) { |
5289 if (dart.notNull(core.identical(Zone._current, _ROOT_ZONE))) | 5212 if (dart.notNull(core.identical(Zone._current, _ROOT_ZONE))) |
5290 return f(); | 5213 return f(); |
5291 return _rootRun(null, null, this, f); | 5214 return _rootRun(null, null, this, f); |
5292 } | 5215 } |
5293 runUnary(f, arg) { | 5216 runUnary(f, arg) { |
5294 if (dart.notNull(core.identical(Zone._current, _ROOT_ZONE))) | 5217 if (dart.notNull(core.identical(Zone._current, _ROOT_ZONE))) |
5295 return dart.dcall(f, arg); | 5218 return dart.dcall(f, arg); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5514 } | 5437 } |
5515 runBinaryGuarded(f, arg1, arg2) { | 5438 runBinaryGuarded(f, arg1, arg2) { |
5516 try { | 5439 try { |
5517 return this.runBinary(f, arg1, arg2); | 5440 return this.runBinary(f, arg1, arg2); |
5518 } catch (e) { | 5441 } catch (e) { |
5519 let s = dart.stackTrace(e); | 5442 let s = dart.stackTrace(e); |
5520 return this.handleUncaughtError(e, s); | 5443 return this.handleUncaughtError(e, s); |
5521 } | 5444 } |
5522 | 5445 |
5523 } | 5446 } |
5524 bindCallback(f, opts) { | 5447 bindCallback(f, {runGuarded = true} = {}) { |
5525 let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true; | |
5526 let registered = this.registerCallback(f); | 5448 let registered = this.registerCallback(f); |
5527 if (dart.notNull(runGuarded)) { | 5449 if (dart.notNull(runGuarded)) { |
5528 return dart.fn((() => this.runGuarded(registered)).bind(this)); | 5450 return dart.fn((() => this.runGuarded(registered)).bind(this)); |
5529 } else { | 5451 } else { |
5530 return dart.fn((() => this.run(registered)).bind(this)); | 5452 return dart.fn((() => this.run(registered)).bind(this)); |
5531 } | 5453 } |
5532 } | 5454 } |
5533 bindUnaryCallback(f, opts) { | 5455 bindUnaryCallback(f, {runGuarded = true} = {}) { |
5534 let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true; | |
5535 let registered = this.registerUnaryCallback(f); | 5456 let registered = this.registerUnaryCallback(f); |
5536 if (dart.notNull(runGuarded)) { | 5457 if (dart.notNull(runGuarded)) { |
5537 return dart.fn((arg => this.runUnaryGuarded(registered, arg)).bind(this)
); | 5458 return dart.fn((arg => this.runUnaryGuarded(registered, arg)).bind(this)
); |
5538 } else { | 5459 } else { |
5539 return dart.fn((arg => this.runUnary(registered, arg)).bind(this)); | 5460 return dart.fn((arg => this.runUnary(registered, arg)).bind(this)); |
5540 } | 5461 } |
5541 } | 5462 } |
5542 bindBinaryCallback(f, opts) { | 5463 bindBinaryCallback(f, {runGuarded = true} = {}) { |
5543 let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true; | |
5544 let registered = this.registerBinaryCallback(f); | 5464 let registered = this.registerBinaryCallback(f); |
5545 if (dart.notNull(runGuarded)) { | 5465 if (dart.notNull(runGuarded)) { |
5546 return dart.fn(((arg1, arg2) => this.runBinaryGuarded(registered, arg1,
arg2)).bind(this)); | 5466 return dart.fn(((arg1, arg2) => this.runBinaryGuarded(registered, arg1,
arg2)).bind(this)); |
5547 } else { | 5467 } else { |
5548 return dart.fn(((arg1, arg2) => this.runBinary(registered, arg1, arg2)).
bind(this)); | 5468 return dart.fn(((arg1, arg2) => this.runBinary(registered, arg1, arg2)).
bind(this)); |
5549 } | 5469 } |
5550 } | 5470 } |
5551 get(key) { | 5471 get(key) { |
5552 let result = this[_map].get(key); | 5472 let result = this[_map].get(key); |
5553 if (result != null || dart.notNull(this[_map].containsKey(key))) | 5473 if (result != null || dart.notNull(this[_map].containsKey(key))) |
5554 return result; | 5474 return result; |
5555 if (this.parent != null) { | 5475 if (this.parent != null) { |
5556 let value = this.parent.get(key); | 5476 let value = this.parent.get(key); |
5557 if (value != null) { | 5477 if (value != null) { |
5558 this[_map].set(key, value); | 5478 this[_map].set(key, value); |
5559 } | 5479 } |
5560 return value; | 5480 return value; |
5561 } | 5481 } |
5562 dart.assert(dart.equals(this, _ROOT_ZONE)); | 5482 dart.assert(dart.equals(this, _ROOT_ZONE)); |
5563 return null; | 5483 return null; |
5564 } | 5484 } |
5565 handleUncaughtError(error, stackTrace) { | 5485 handleUncaughtError(error, stackTrace) { |
5566 let implementation = this[_handleUncaughtError]; | 5486 let implementation = this[_handleUncaughtError]; |
5567 dart.assert(implementation != null); | 5487 dart.assert(implementation != null); |
5568 let parentDelegate = _parentDelegate(implementation.zone); | 5488 let parentDelegate = _parentDelegate(implementation.zone); |
5569 return dart.dcall(implementation.function, implementation.zone, parentDele
gate, this, error, stackTrace); | 5489 return dart.dcall(implementation.function, implementation.zone, parentDele
gate, this, error, stackTrace); |
5570 } | 5490 } |
5571 fork(opts) { | 5491 fork({specification = null, zoneValues = null} = {}) { |
5572 let specification = opts && 'specification' in opts ? opts.specification :
null; | |
5573 let zoneValues = opts && 'zoneValues' in opts ? opts.zoneValues : null; | |
5574 let implementation = this[_fork]; | 5492 let implementation = this[_fork]; |
5575 dart.assert(implementation != null); | 5493 dart.assert(implementation != null); |
5576 let parentDelegate = _parentDelegate(implementation.zone); | 5494 let parentDelegate = _parentDelegate(implementation.zone); |
5577 return dart.as(dart.dcall(implementation.function, implementation.zone, pa
rentDelegate, this, specification, zoneValues), Zone); | 5495 return dart.as(dart.dcall(implementation.function, implementation.zone, pa
rentDelegate, this, specification, zoneValues), Zone); |
5578 } | 5496 } |
5579 run(f) { | 5497 run(f) { |
5580 let implementation = this[_run]; | 5498 let implementation = this[_run]; |
5581 dart.assert(implementation != null); | 5499 dart.assert(implementation != null); |
5582 let parentDelegate = _parentDelegate(implementation.zone); | 5500 let parentDelegate = _parentDelegate(implementation.zone); |
5583 return dart.dcall(implementation.function, implementation.zone, parentDele
gate, this, f); | 5501 return dart.dcall(implementation.function, implementation.zone, parentDele
gate, this, f); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5818 } | 5736 } |
5819 } | 5737 } |
5820 _RootZoneSpecification[dart.implements] = () => [ZoneSpecification]; | 5738 _RootZoneSpecification[dart.implements] = () => [ZoneSpecification]; |
5821 _RootZone._rootDelegate = null; | 5739 _RootZone._rootDelegate = null; |
5822 dart.defineLazyProperties(_RootZone, { | 5740 dart.defineLazyProperties(_RootZone, { |
5823 get _rootMap() { | 5741 get _rootMap() { |
5824 return collection.HashMap.new(); | 5742 return collection.HashMap.new(); |
5825 }, | 5743 }, |
5826 set _rootMap(_) {} | 5744 set _rootMap(_) {} |
5827 }); | 5745 }); |
5828 function runZoned(body, opts) { | 5746 function runZoned(body, {zoneValues = null, zoneSpecification = null, onError
= null} = {}) { |
5829 let zoneValues = opts && 'zoneValues' in opts ? opts.zoneValues : null; | |
5830 let zoneSpecification = opts && 'zoneSpecification' in opts ? opts.zoneSpeci
fication : null; | |
5831 let onError = opts && 'onError' in opts ? opts.onError : null; | |
5832 let errorHandler = null; | 5747 let errorHandler = null; |
5833 if (onError != null) { | 5748 if (onError != null) { |
5834 errorHandler = dart.fn((self, parent, zone, error, stackTrace) => { | 5749 errorHandler = dart.fn((self, parent, zone, error, stackTrace) => { |
5835 try { | 5750 try { |
5836 if (dart.is(onError, ZoneBinaryCallback)) { | 5751 if (dart.is(onError, ZoneBinaryCallback)) { |
5837 return self.parent.runBinary(onError, error, stackTrace); | 5752 return self.parent.runBinary(onError, error, stackTrace); |
5838 } | 5753 } |
5839 return self.parent.runUnary(dart.as(onError, __CastType38), error); | 5754 return self.parent.runUnary(dart.as(onError, __CastType38), error); |
5840 } catch (e) { | 5755 } catch (e) { |
5841 let s = dart.stackTrace(e); | 5756 let s = dart.stackTrace(e); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5911 exports.ScheduleMicrotaskHandler = ScheduleMicrotaskHandler; | 5826 exports.ScheduleMicrotaskHandler = ScheduleMicrotaskHandler; |
5912 exports.CreateTimerHandler = CreateTimerHandler; | 5827 exports.CreateTimerHandler = CreateTimerHandler; |
5913 exports.CreatePeriodicTimerHandler = CreatePeriodicTimerHandler; | 5828 exports.CreatePeriodicTimerHandler = CreatePeriodicTimerHandler; |
5914 exports.PrintHandler = PrintHandler; | 5829 exports.PrintHandler = PrintHandler; |
5915 exports.ForkHandler = ForkHandler; | 5830 exports.ForkHandler = ForkHandler; |
5916 exports.ZoneSpecification = ZoneSpecification; | 5831 exports.ZoneSpecification = ZoneSpecification; |
5917 exports.ZoneDelegate = ZoneDelegate; | 5832 exports.ZoneDelegate = ZoneDelegate; |
5918 exports.Zone = Zone; | 5833 exports.Zone = Zone; |
5919 exports.runZoned = runZoned; | 5834 exports.runZoned = runZoned; |
5920 }); | 5835 }); |
OLD | NEW |