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

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

Issue 1020043002: Replace dart_core.js with actual compiled SDK (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: merge Created 5 years, 9 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
« no previous file with comments | « lib/runtime/dart/_native_typed_data.js ('k') | lib/runtime/dart/collection.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 }).bind(this)}); 117 }).bind(this)});
118 return controller.stream; 118 return controller.stream;
119 } 119 }
120 Stream$eventTransformed(source, mapSink) { 120 Stream$eventTransformed(source, mapSink) {
121 return dart.as(new _BoundSinkStream(source, dart.closureWrap(mapSink, "( EventSink<dynamic>) → EventSink")), Stream$(T)); 121 return dart.as(new _BoundSinkStream(source, dart.closureWrap(mapSink, "( EventSink<dynamic>) → EventSink")), Stream$(T));
122 } 122 }
123 get isBroadcast() { 123 get isBroadcast() {
124 return false; 124 return false;
125 } 125 }
126 asBroadcastStream(opt$) { 126 asBroadcastStream(opt$) {
127 let onListen = opt$.onListen === void 0 ? null : opt$.onListen; 127 let onListen = opt$ && 'onListen' in opt$ ? opt$.onListen : null;
128 let onCancel = opt$.onCancel === void 0 ? null : opt$.onCancel; 128 let onCancel = opt$ && 'onCancel' in opt$ ? opt$.onCancel : null;
129 return new _AsBroadcastStream(this, dart.closureWrap(onListen, "(StreamS ubscription<dynamic>) → void"), dart.closureWrap(onCancel, "(StreamSubscription< dynamic>) → void")); 129 return new _AsBroadcastStream(this, dart.closureWrap(onListen, "(StreamS ubscription<dynamic>) → void"), dart.closureWrap(onCancel, "(StreamSubscription< dynamic>) → void"));
130 } 130 }
131 where(test) { 131 where(test) {
132 return new _WhereStream(this, test); 132 return new _WhereStream(this, test);
133 } 133 }
134 map(convert) { 134 map(convert) {
135 return new _MapStream(this, convert); 135 return new _MapStream(this, convert);
136 } 136 }
137 asyncMap(convert) { 137 asyncMap(convert) {
138 let controller = null; 138 let controller = null;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 subscription.pause(); 208 subscription.pause();
209 }).bind(this), onResume: (() => { 209 }).bind(this), onResume: (() => {
210 subscription.resume(); 210 subscription.resume();
211 }).bind(this), onCancel: (() => { 211 }).bind(this), onCancel: (() => {
212 subscription.cancel(); 212 subscription.cancel();
213 }).bind(this), sync: true}); 213 }).bind(this), sync: true});
214 } 214 }
215 return controller.stream; 215 return controller.stream;
216 } 216 }
217 handleError(onError, opt$) { 217 handleError(onError, opt$) {
218 let test = opt$.test === void 0 ? null : opt$.test; 218 let test = opt$ && 'test' in opt$ ? opt$.test : null;
219 return new _HandleErrorStream(this, onError, test); 219 return new _HandleErrorStream(this, onError, test);
220 } 220 }
221 expand(convert) { 221 expand(convert) {
222 return new _ExpandStream(this, convert); 222 return new _ExpandStream(this, convert);
223 } 223 }
224 pipe(streamConsumer) { 224 pipe(streamConsumer) {
225 return streamConsumer.addStream(this).then(((_) => streamConsumer.close( )).bind(this)); 225 return streamConsumer.addStream(this).then(((_) => streamConsumer.close( )).bind(this));
226 } 226 }
227 transform(streamTransformer) { 227 transform(streamTransformer) {
228 return streamTransformer.bind(this); 228 return streamTransformer.bind(this);
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 throw _internal.IterableElementError.noElement(); 482 throw _internal.IterableElementError.noElement();
483 } catch (e) { 483 } catch (e) {
484 let s = dart.stackTrace(e); 484 let s = dart.stackTrace(e);
485 _completeWithErrorCallback(future, e, s); 485 _completeWithErrorCallback(future, e, s);
486 } 486 }
487 487
488 }).bind(this), cancelOnError: true}); 488 }).bind(this), cancelOnError: true});
489 return future; 489 return future;
490 } 490 }
491 firstWhere(test, opt$) { 491 firstWhere(test, opt$) {
492 let defaultValue = opt$.defaultValue === void 0 ? null : opt$.defaultVal ue; 492 let defaultValue = opt$ && 'defaultValue' in opt$ ? opt$.defaultValue : null;
493 let future = new _Future(); 493 let future = new _Future();
494 let subscription = null; 494 let subscription = null;
495 subscription = this.listen((value) => { 495 subscription = this.listen((value) => {
496 _runUserCode(() => test(value), (isMatch) => { 496 _runUserCode(() => test(value), (isMatch) => {
497 if (isMatch) { 497 if (isMatch) {
498 _cancelAndValue(subscription, future, value); 498 _cancelAndValue(subscription, future, value);
499 } 499 }
500 }, dart.as(_cancelAndErrorClosure(subscription, future), dart.throw_(" Unimplemented type (dynamic, StackTrace) → dynamic"))); 500 }, dart.as(_cancelAndErrorClosure(subscription, future), dart.throw_(" Unimplemented type (dynamic, StackTrace) → dynamic")));
501 }, {onError: future[_completeError], onDone: (() => { 501 }, {onError: future[_completeError], onDone: (() => {
502 if (defaultValue !== null) { 502 if (defaultValue !== null) {
503 _runUserCode(defaultValue, future[_complete], future[_completeErro r]); 503 _runUserCode(defaultValue, future[_complete], future[_completeErro r]);
504 return; 504 return;
505 } 505 }
506 try { 506 try {
507 throw _internal.IterableElementError.noElement(); 507 throw _internal.IterableElementError.noElement();
508 } catch (e) { 508 } catch (e) {
509 let s = dart.stackTrace(e); 509 let s = dart.stackTrace(e);
510 _completeWithErrorCallback(future, e, s); 510 _completeWithErrorCallback(future, e, s);
511 } 511 }
512 512
513 }).bind(this), cancelOnError: true}); 513 }).bind(this), cancelOnError: true});
514 return future; 514 return future;
515 } 515 }
516 lastWhere(test, opt$) { 516 lastWhere(test, opt$) {
517 let defaultValue = opt$.defaultValue === void 0 ? null : opt$.defaultVal ue; 517 let defaultValue = opt$ && 'defaultValue' in opt$ ? opt$.defaultValue : null;
518 let future = new _Future(); 518 let future = new _Future();
519 let result = null; 519 let result = null;
520 let foundResult = false; 520 let foundResult = false;
521 let subscription = null; 521 let subscription = null;
522 subscription = this.listen((value) => { 522 subscription = this.listen((value) => {
523 _runUserCode(() => true === test(value), (isMatch) => { 523 _runUserCode(() => true === test(value), (isMatch) => {
524 if (isMatch) { 524 if (isMatch) {
525 foundResult = true; 525 foundResult = true;
526 result = value; 526 result = value;
527 } 527 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 _cancelAndValue(subscription, future, value); 593 _cancelAndValue(subscription, future, value);
594 return; 594 return;
595 } 595 }
596 elementIndex = 1; 596 elementIndex = 1;
597 }, {onError: future[_completeError], onDone: (() => { 597 }, {onError: future[_completeError], onDone: (() => {
598 future._completeError(new core.RangeError.index(index, this, "index" , null, elementIndex)); 598 future._completeError(new core.RangeError.index(index, this, "index" , null, elementIndex));
599 }).bind(this), cancelOnError: true}); 599 }).bind(this), cancelOnError: true});
600 return future; 600 return future;
601 } 601 }
602 timeout(timeLimit, opt$) { 602 timeout(timeLimit, opt$) {
603 let onTimeout = opt$.onTimeout === void 0 ? null : opt$.onTimeout; 603 let onTimeout = opt$ && 'onTimeout' in opt$ ? opt$.onTimeout : null;
604 let controller = null; 604 let controller = null;
605 let subscription = null; 605 let subscription = null;
606 let timer = null; 606 let timer = null;
607 let zone = null; 607 let zone = null;
608 let timeout = null; 608 let timeout = null;
609 // Function onData: (T) → void 609 // Function onData: (T) → void
610 function onData(event) { 610 function onData(event) {
611 timer.cancel(); 611 timer.cancel();
612 controller.add(event); 612 controller.add(event);
613 timer = zone.createTimer(timeLimit, dart.as(timeout, dart.throw_("Unim plemented type () → void"))); 613 timer = zone.createTimer(timeLimit, dart.as(timeout, dart.throw_("Unim plemented type () → void")));
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 dart.defineNamedConstructor(Stream, 'fromFuture'); 664 dart.defineNamedConstructor(Stream, 'fromFuture');
665 dart.defineNamedConstructor(Stream, 'fromIterable'); 665 dart.defineNamedConstructor(Stream, 'fromIterable');
666 dart.defineNamedConstructor(Stream, 'periodic'); 666 dart.defineNamedConstructor(Stream, 'periodic');
667 dart.defineNamedConstructor(Stream, 'eventTransformed'); 667 dart.defineNamedConstructor(Stream, 'eventTransformed');
668 return Stream; 668 return Stream;
669 }); 669 });
670 let Stream = Stream$(dart.dynamic); 670 let Stream = Stream$(dart.dynamic);
671 let _StreamImpl$ = dart.generic(function(T) { 671 let _StreamImpl$ = dart.generic(function(T) {
672 class _StreamImpl extends Stream$(T) { 672 class _StreamImpl extends Stream$(T) {
673 listen(onData, opt$) { 673 listen(onData, opt$) {
674 let onError = opt$.onError === void 0 ? null : opt$.onError; 674 let onError = opt$ && 'onError' in opt$ ? opt$.onError : null;
675 let onDone = opt$.onDone === void 0 ? null : opt$.onDone; 675 let onDone = opt$ && 'onDone' in opt$ ? opt$.onDone : null;
676 let cancelOnError = opt$.cancelOnError === void 0 ? null : opt$.cancelOn Error; 676 let cancelOnError = opt$ && 'cancelOnError' in opt$ ? opt$.cancelOnError : null;
677 cancelOnError = core.identical(true, cancelOnError); 677 cancelOnError = core.identical(true, cancelOnError);
678 let subscription = this[_createSubscription](onData, onError, onDone, ca ncelOnError); 678 let subscription = this[_createSubscription](onData, onError, onDone, ca ncelOnError);
679 this[_onListen](subscription); 679 this[_onListen](subscription);
680 return dart.as(subscription, StreamSubscription$(T)); 680 return dart.as(subscription, StreamSubscription$(T));
681 } 681 }
682 [_createSubscription](onData, onError, onDone, cancelOnError) { 682 [_createSubscription](onData, onError, onDone, cancelOnError) {
683 return new _BufferingStreamSubscription(onData, onError, onDone, cancelO nError); 683 return new _BufferingStreamSubscription(onData, onError, onDone, cancelO nError);
684 } 684 }
685 [_onListen](subscription) {} 685 [_onListen](subscription) {}
686 } 686 }
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 throw this[_addEventError](); 1281 throw this[_addEventError]();
1282 this[_state] = _BroadcastStreamController._STATE_CLOSED; 1282 this[_state] = _BroadcastStreamController._STATE_CLOSED;
1283 let doneFuture = this[_ensureDoneFuture](); 1283 let doneFuture = this[_ensureDoneFuture]();
1284 this[_sendDone](); 1284 this[_sendDone]();
1285 return doneFuture; 1285 return doneFuture;
1286 } 1286 }
1287 get done() { 1287 get done() {
1288 return this[_ensureDoneFuture](); 1288 return this[_ensureDoneFuture]();
1289 } 1289 }
1290 addStream(stream, opt$) { 1290 addStream(stream, opt$) {
1291 let cancelOnError = opt$.cancelOnError === void 0 ? true : opt$.cancelOn Error; 1291 let cancelOnError = opt$ && 'cancelOnError' in opt$ ? opt$.cancelOnError : true;
1292 if (!dart.notNull(this[_mayAddEvent])) 1292 if (!dart.notNull(this[_mayAddEvent]))
1293 throw this[_addEventError](); 1293 throw this[_addEventError]();
1294 this[_state] = _BroadcastStreamController._STATE_ADDSTREAM; 1294 this[_state] = _BroadcastStreamController._STATE_ADDSTREAM;
1295 this[_addStreamState] = dart.as(new _AddStreamState(this, stream, cancel OnError), _AddStreamState$(T)); 1295 this[_addStreamState] = dart.as(new _AddStreamState(this, stream, cancel OnError), _AddStreamState$(T));
1296 return this[_addStreamState].addStreamFuture; 1296 return this[_addStreamState].addStreamFuture;
1297 } 1297 }
1298 [_add](data) { 1298 [_add](data) {
1299 this[_sendData](data); 1299 this[_sendData](data);
1300 } 1300 }
1301 [_addError](error, stackTrace) { 1301 [_addError](error, stackTrace) {
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 if (value === void 0) 1526 if (value === void 0)
1527 value = null; 1527 value = null;
1528 return new _Future(); 1528 return new _Future();
1529 } 1529 }
1530 } 1530 }
1531 return _DoneSubscription; 1531 return _DoneSubscription;
1532 }); 1532 });
1533 let _DoneSubscription = _DoneSubscription$(dart.dynamic); 1533 let _DoneSubscription = _DoneSubscription$(dart.dynamic);
1534 class DeferredLibrary extends core.Object { 1534 class DeferredLibrary extends core.Object {
1535 DeferredLibrary(libraryName, opt$) { 1535 DeferredLibrary(libraryName, opt$) {
1536 let uri = opt$.uri === void 0 ? null : opt$.uri; 1536 let uri = opt$ && 'uri' in opt$ ? opt$.uri : null;
1537 this.libraryName = libraryName; 1537 this.libraryName = libraryName;
1538 this.uri = uri; 1538 this.uri = uri;
1539 } 1539 }
1540 load() { 1540 load() {
1541 throw 'DeferredLibrary not supported. ' + 'please use the `import "lib.dar t" deferred as lib` syntax.'; 1541 throw 'DeferredLibrary not supported. ' + 'please use the `import "lib.dar t" deferred as lib` syntax.';
1542 } 1542 }
1543 } 1543 }
1544 let _s = Symbol('_s'); 1544 let _s = Symbol('_s');
1545 class DeferredLoadException extends core.Object { 1545 class DeferredLoadException extends core.Object {
1546 DeferredLoadException($_s) { 1546 DeferredLoadException($_s) {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 result._complete(computation === null ? null : computation()); 1615 result._complete(computation === null ? null : computation());
1616 } catch (e) { 1616 } catch (e) {
1617 let s = dart.stackTrace(e); 1617 let s = dart.stackTrace(e);
1618 _completeWithErrorCallback(result, e, s); 1618 _completeWithErrorCallback(result, e, s);
1619 } 1619 }
1620 1620
1621 }).bind(this)); 1621 }).bind(this));
1622 return dart.as(result, Future$(T)); 1622 return dart.as(result, Future$(T));
1623 } 1623 }
1624 static wait(futures, opt$) { 1624 static wait(futures, opt$) {
1625 let eagerError = opt$.eagerError === void 0 ? false : opt$.eagerError; 1625 let eagerError = opt$ && 'eagerError' in opt$ ? opt$.eagerError : false;
1626 let cleanUp = opt$.cleanUp === void 0 ? null : opt$.cleanUp; 1626 let cleanUp = opt$ && 'cleanUp' in opt$ ? opt$.cleanUp : null;
1627 let result = new _Future(); 1627 let result = new _Future();
1628 let values = null; 1628 let values = null;
1629 let remaining = 0; 1629 let remaining = 0;
1630 let error = null; 1630 let error = null;
1631 let stackTrace = null; 1631 let stackTrace = null;
1632 // Function handleError: (dynamic, dynamic) → void 1632 // Function handleError: (dynamic, dynamic) → void
1633 function handleError(theError, theStackTrace) { 1633 function handleError(theError, theStackTrace) {
1634 remaining = dart.notNull(remaining) - 1; 1634 remaining = dart.notNull(remaining) - 1;
1635 if (values !== null) { 1635 if (values !== null) {
1636 if (cleanUp !== null) { 1636 if (cleanUp !== null) {
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1949 set [_isChained](value) { 1949 set [_isChained](value) {
1950 if (value) { 1950 if (value) {
1951 dart.assert(!dart.notNull(this[_isComplete])); 1951 dart.assert(!dart.notNull(this[_isComplete]));
1952 this[_state] = _Future._CHAINED; 1952 this[_state] = _Future._CHAINED;
1953 } else { 1953 } else {
1954 dart.assert(this[_isChained]); 1954 dart.assert(this[_isChained]);
1955 this[_state] = _Future._INCOMPLETE; 1955 this[_state] = _Future._INCOMPLETE;
1956 } 1956 }
1957 } 1957 }
1958 then(f, opt$) { 1958 then(f, opt$) {
1959 let onError = opt$.onError === void 0 ? null : opt$.onError; 1959 let onError = opt$ && 'onError' in opt$ ? opt$.onError : null;
1960 let result = new _Future(); 1960 let result = new _Future();
1961 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { 1961 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) {
1962 f = dart.closureWrap(result[_zone].registerUnaryCallback(f), "(T) → dy namic"); 1962 f = dart.closureWrap(result[_zone].registerUnaryCallback(f), "(T) → dy namic");
1963 if (onError !== null) { 1963 if (onError !== null) {
1964 onError = _registerErrorHandler(onError, result[_zone]); 1964 onError = _registerErrorHandler(onError, result[_zone]);
1965 } 1965 }
1966 } 1966 }
1967 this[_addListener](new _FutureListener.then(result, f, onError)); 1967 this[_addListener](new _FutureListener.then(result, f, onError));
1968 return result; 1968 return result;
1969 } 1969 }
1970 catchError(onError, opt$) { 1970 catchError(onError, opt$) {
1971 let test = opt$.test === void 0 ? null : opt$.test; 1971 let test = opt$ && 'test' in opt$ ? opt$.test : null;
1972 let result = new _Future(); 1972 let result = new _Future();
1973 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) { 1973 if (!dart.notNull(core.identical(result[_zone], _ROOT_ZONE))) {
1974 onError = _registerErrorHandler(onError, result[_zone]); 1974 onError = _registerErrorHandler(onError, result[_zone]);
1975 if (test !== null) 1975 if (test !== null)
1976 test = dart.closureWrap(result[_zone].registerUnaryCallback(test), " (dynamic) → bool"); 1976 test = dart.closureWrap(result[_zone].registerUnaryCallback(test), " (dynamic) → bool");
1977 } 1977 }
1978 this[_addListener](new _FutureListener.catchError(result, onError, test) ); 1978 this[_addListener](new _FutureListener.catchError(result, onError, test) );
1979 return result; 1979 return result;
1980 } 1980 }
1981 whenComplete(action) { 1981 whenComplete(action) {
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
2281 if (listenerHasValue) { 2281 if (listenerHasValue) {
2282 result._setValue(listenerValueOrError); 2282 result._setValue(listenerValueOrError);
2283 } else { 2283 } else {
2284 let asyncError = dart.as(listenerValueOrError, AsyncError); 2284 let asyncError = dart.as(listenerValueOrError, AsyncError);
2285 result._setErrorObject(asyncError); 2285 result._setErrorObject(asyncError);
2286 } 2286 }
2287 source = result; 2287 source = result;
2288 } 2288 }
2289 } 2289 }
2290 timeout(timeLimit, opt$) { 2290 timeout(timeLimit, opt$) {
2291 let onTimeout = opt$.onTimeout === void 0 ? null : opt$.onTimeout; 2291 let onTimeout = opt$ && 'onTimeout' in opt$ ? opt$.onTimeout : null;
2292 if (this[_isComplete]) 2292 if (this[_isComplete])
2293 return new _Future.immediate(this); 2293 return new _Future.immediate(this);
2294 let result = new _Future(); 2294 let result = new _Future();
2295 let timer = null; 2295 let timer = null;
2296 if (onTimeout === null) { 2296 if (onTimeout === null) {
2297 timer = new Timer(timeLimit, (() => { 2297 timer = new Timer(timeLimit, (() => {
2298 result._completeError(new TimeoutException("Future not completed", t imeLimit)); 2298 result._completeError(new TimeoutException("Future not completed", t imeLimit));
2299 }).bind(this)); 2299 }).bind(this));
2300 } else { 2300 } else {
2301 let zone = Zone.current; 2301 let zone = Zone.current;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2490 let StreamView$ = dart.generic(function(T) { 2490 let StreamView$ = dart.generic(function(T) {
2491 class StreamView extends Stream$(T) { 2491 class StreamView extends Stream$(T) {
2492 StreamView($_stream) { 2492 StreamView($_stream) {
2493 this[_stream] = $_stream; 2493 this[_stream] = $_stream;
2494 super.Stream(); 2494 super.Stream();
2495 } 2495 }
2496 get isBroadcast() { 2496 get isBroadcast() {
2497 return this[_stream].isBroadcast; 2497 return this[_stream].isBroadcast;
2498 } 2498 }
2499 asBroadcastStream(opt$) { 2499 asBroadcastStream(opt$) {
2500 let onListen = opt$.onListen === void 0 ? null : opt$.onListen; 2500 let onListen = opt$ && 'onListen' in opt$ ? opt$.onListen : null;
2501 let onCancel = opt$.onCancel === void 0 ? null : opt$.onCancel; 2501 let onCancel = opt$ && 'onCancel' in opt$ ? opt$.onCancel : null;
2502 return this[_stream].asBroadcastStream({onListen: onListen, onCancel: on Cancel}); 2502 return this[_stream].asBroadcastStream({onListen: onListen, onCancel: on Cancel});
2503 } 2503 }
2504 listen(onData, opt$) { 2504 listen(onData, opt$) {
2505 let onError = opt$.onError === void 0 ? null : opt$.onError; 2505 let onError = opt$ && 'onError' in opt$ ? opt$.onError : null;
2506 let onDone = opt$.onDone === void 0 ? null : opt$.onDone; 2506 let onDone = opt$ && 'onDone' in opt$ ? opt$.onDone : null;
2507 let cancelOnError = opt$.cancelOnError === void 0 ? null : opt$.cancelOn Error; 2507 let cancelOnError = opt$ && 'cancelOnError' in opt$ ? opt$.cancelOnError : null;
2508 return this[_stream].listen(onData, {onError: onError, onDone: onDone, c ancelOnError: cancelOnError}); 2508 return this[_stream].listen(onData, {onError: onError, onDone: onDone, c ancelOnError: cancelOnError});
2509 } 2509 }
2510 } 2510 }
2511 return StreamView; 2511 return StreamView;
2512 }); 2512 });
2513 let StreamView = StreamView$(dart.dynamic); 2513 let StreamView = StreamView$(dart.dynamic);
2514 let StreamConsumer$ = dart.generic(function(S) { 2514 let StreamConsumer$ = dart.generic(function(S) {
2515 class StreamConsumer extends core.Object { 2515 class StreamConsumer extends core.Object {
2516 } 2516 }
2517 return StreamConsumer; 2517 return StreamConsumer;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
2561 close() { 2561 close() {
2562 this[_sink].close(); 2562 this[_sink].close();
2563 } 2563 }
2564 } 2564 }
2565 return _ControllerEventSinkWrapper; 2565 return _ControllerEventSinkWrapper;
2566 }); 2566 });
2567 let _ControllerEventSinkWrapper = _ControllerEventSinkWrapper$(dart.dynamic); 2567 let _ControllerEventSinkWrapper = _ControllerEventSinkWrapper$(dart.dynamic);
2568 let StreamController$ = dart.generic(function(T) { 2568 let StreamController$ = dart.generic(function(T) {
2569 class StreamController extends core.Object { 2569 class StreamController extends core.Object {
2570 StreamController(opt$) { 2570 StreamController(opt$) {
2571 let onListen = opt$.onListen === void 0 ? null : opt$.onListen; 2571 let onListen = opt$ && 'onListen' in opt$ ? opt$.onListen : null;
2572 let onPause = opt$.onPause === void 0 ? null : opt$.onPause; 2572 let onPause = opt$ && 'onPause' in opt$ ? opt$.onPause : null;
2573 let onResume = opt$.onResume === void 0 ? null : opt$.onResume; 2573 let onResume = opt$ && 'onResume' in opt$ ? opt$.onResume : null;
2574 let onCancel = opt$.onCancel === void 0 ? null : opt$.onCancel; 2574 let onCancel = opt$ && 'onCancel' in opt$ ? opt$.onCancel : null;
2575 let sync = opt$.sync === void 0 ? false : opt$.sync; 2575 let sync = opt$ && 'sync' in opt$ ? opt$.sync : false;
2576 if (dart.notNull(onListen === null) && dart.notNull(onPause === null) && dart.notNull(onResume === null) && dart.notNull(onCancel === null)) { 2576 if (dart.notNull(onListen === null) && dart.notNull(onPause === null) && dart.notNull(onResume === null) && dart.notNull(onCancel === null)) {
2577 return dart.as(sync ? new _NoCallbackSyncStreamController() : new _NoC allbackAsyncStreamController(), StreamController$(T)); 2577 return dart.as(sync ? new _NoCallbackSyncStreamController() : new _NoC allbackAsyncStreamController(), StreamController$(T));
2578 } 2578 }
2579 return sync ? new _SyncStreamController(onListen, onPause, onResume, onC ancel) : new _AsyncStreamController(onListen, onPause, onResume, onCancel); 2579 return sync ? new _SyncStreamController(onListen, onPause, onResume, onC ancel) : new _AsyncStreamController(onListen, onPause, onResume, onCancel);
2580 } 2580 }
2581 StreamController$broadcast(opt$) { 2581 StreamController$broadcast(opt$) {
2582 let onListen = opt$.onListen === void 0 ? null : opt$.onListen; 2582 let onListen = opt$ && 'onListen' in opt$ ? opt$.onListen : null;
2583 let onCancel = opt$.onCancel === void 0 ? null : opt$.onCancel; 2583 let onCancel = opt$ && 'onCancel' in opt$ ? opt$.onCancel : null;
2584 let sync = opt$.sync === void 0 ? false : opt$.sync; 2584 let sync = opt$ && 'sync' in opt$ ? opt$.sync : false;
2585 return sync ? new _SyncBroadcastStreamController(onListen, onCancel) : n ew _AsyncBroadcastStreamController(onListen, onCancel); 2585 return sync ? new _SyncBroadcastStreamController(onListen, onCancel) : n ew _AsyncBroadcastStreamController(onListen, onCancel);
2586 } 2586 }
2587 } 2587 }
2588 dart.defineNamedConstructor(StreamController, 'broadcast'); 2588 dart.defineNamedConstructor(StreamController, 'broadcast');
2589 return StreamController; 2589 return StreamController;
2590 }); 2590 });
2591 let StreamController = StreamController$(dart.dynamic); 2591 let StreamController = StreamController$(dart.dynamic);
2592 let _StreamControllerLifecycle$ = dart.generic(function(T) { 2592 let _StreamControllerLifecycle$ = dart.generic(function(T) {
2593 class _StreamControllerLifecycle extends core.Object { 2593 class _StreamControllerLifecycle extends core.Object {
2594 [_recordPause](subscription) {} 2594 [_recordPause](subscription) {}
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
2671 return dart.as(this[_varData], _ControllerSubscription); 2671 return dart.as(this[_varData], _ControllerSubscription);
2672 } 2672 }
2673 [_badEventState]() { 2673 [_badEventState]() {
2674 if (this.isClosed) { 2674 if (this.isClosed) {
2675 return new core.StateError("Cannot add event after closing"); 2675 return new core.StateError("Cannot add event after closing");
2676 } 2676 }
2677 dart.assert(this[_isAddingStream]); 2677 dart.assert(this[_isAddingStream]);
2678 return new core.StateError("Cannot add event while adding a stream"); 2678 return new core.StateError("Cannot add event while adding a stream");
2679 } 2679 }
2680 addStream(source, opt$) { 2680 addStream(source, opt$) {
2681 let cancelOnError = opt$.cancelOnError === void 0 ? true : opt$.cancelOn Error; 2681 let cancelOnError = opt$ && 'cancelOnError' in opt$ ? opt$.cancelOnError : true;
2682 if (!dart.notNull(this[_mayAddEvent])) 2682 if (!dart.notNull(this[_mayAddEvent]))
2683 throw this[_badEventState](); 2683 throw this[_badEventState]();
2684 if (this[_isCanceled]) 2684 if (this[_isCanceled])
2685 return new _Future.immediate(null); 2685 return new _Future.immediate(null);
2686 let addState = new _StreamControllerAddStreamState(this, this[_varData], source, cancelOnError); 2686 let addState = new _StreamControllerAddStreamState(this, this[_varData], source, cancelOnError);
2687 this[_varData] = addState; 2687 this[_varData] = addState;
2688 this[_state] = _StreamController._STATE_ADDSTREAM; 2688 this[_state] = _StreamController._STATE_ADDSTREAM;
2689 return addState.addStreamFuture; 2689 return addState.addStreamFuture;
2690 } 2690 }
2691 get done() { 2691 get done() {
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
2934 } 2934 }
2935 addError(error, stackTrace) { 2935 addError(error, stackTrace) {
2936 if (stackTrace === void 0) 2936 if (stackTrace === void 0)
2937 stackTrace = null; 2937 stackTrace = null;
2938 this[_target].addError(error, stackTrace); 2938 this[_target].addError(error, stackTrace);
2939 } 2939 }
2940 close() { 2940 close() {
2941 return this[_target].close(); 2941 return this[_target].close();
2942 } 2942 }
2943 addStream(source, opt$) { 2943 addStream(source, opt$) {
2944 let cancelOnError = opt$.cancelOnError === void 0 ? true : opt$.cancelOn Error; 2944 let cancelOnError = opt$ && 'cancelOnError' in opt$ ? opt$.cancelOnError : true;
2945 return this[_target].addStream(source, {cancelOnError: cancelOnError}); 2945 return this[_target].addStream(source, {cancelOnError: cancelOnError});
2946 } 2946 }
2947 get done() { 2947 get done() {
2948 return this[_target].done; 2948 return this[_target].done;
2949 } 2949 }
2950 } 2950 }
2951 return _StreamSinkWrapper; 2951 return _StreamSinkWrapper;
2952 }); 2952 });
2953 let _StreamSinkWrapper = _StreamSinkWrapper$(dart.dynamic); 2953 let _StreamSinkWrapper = _StreamSinkWrapper$(dart.dynamic);
2954 let _AddStreamState$ = dart.generic(function(T) { 2954 let _AddStreamState$ = dart.generic(function(T) {
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
3302 this[_zone] = Zone.current; 3302 this[_zone] = Zone.current;
3303 this[_controller] = null; 3303 this[_controller] = null;
3304 this[_subscription] = null; 3304 this[_subscription] = null;
3305 super.Stream(); 3305 super.Stream();
3306 this[_controller] = new _AsBroadcastStreamController(this[_onListen], th is[_onCancel]); 3306 this[_controller] = new _AsBroadcastStreamController(this[_onListen], th is[_onCancel]);
3307 } 3307 }
3308 get isBroadcast() { 3308 get isBroadcast() {
3309 return true; 3309 return true;
3310 } 3310 }
3311 listen(onData, opt$) { 3311 listen(onData, opt$) {
3312 let onError = opt$.onError === void 0 ? null : opt$.onError; 3312 let onError = opt$ && 'onError' in opt$ ? opt$.onError : null;
3313 let onDone = opt$.onDone === void 0 ? null : opt$.onDone; 3313 let onDone = opt$ && 'onDone' in opt$ ? opt$.onDone : null;
3314 let cancelOnError = opt$.cancelOnError === void 0 ? null : opt$.cancelOn Error; 3314 let cancelOnError = opt$ && 'cancelOnError' in opt$ ? opt$.cancelOnError : null;
3315 if (dart.notNull(this[_controller] === null) || dart.notNull(this[_contr oller].isClosed)) { 3315 if (dart.notNull(this[_controller] === null) || dart.notNull(this[_contr oller].isClosed)) {
3316 return new _DoneStreamSubscription(onDone); 3316 return new _DoneStreamSubscription(onDone);
3317 } 3317 }
3318 if (this[_subscription] === null) { 3318 if (this[_subscription] === null) {
3319 this[_subscription] = this[_source].listen(this[_controller].add, {onE rror: this[_controller].addError, onDone: this[_controller].close}); 3319 this[_subscription] = this[_source].listen(this[_controller].add, {onE rror: this[_controller].addError, onDone: this[_controller].close});
3320 } 3320 }
3321 cancelOnError = core.identical(true, cancelOnError); 3321 cancelOnError = core.identical(true, cancelOnError);
3322 return this[_controller]._subscribe(onData, onError, onDone, cancelOnErr or); 3322 return this[_controller]._subscribe(onData, onError, onDone, cancelOnErr or);
3323 } 3323 }
3324 [_onCancel]() { 3324 [_onCancel]() {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
3569 let _ForwardingStream$ = dart.generic(function(S, T) { 3569 let _ForwardingStream$ = dart.generic(function(S, T) {
3570 class _ForwardingStream extends Stream$(T) { 3570 class _ForwardingStream extends Stream$(T) {
3571 _ForwardingStream($_source) { 3571 _ForwardingStream($_source) {
3572 this[_source] = $_source; 3572 this[_source] = $_source;
3573 super.Stream(); 3573 super.Stream();
3574 } 3574 }
3575 get isBroadcast() { 3575 get isBroadcast() {
3576 return this[_source].isBroadcast; 3576 return this[_source].isBroadcast;
3577 } 3577 }
3578 listen(onData, opt$) { 3578 listen(onData, opt$) {
3579 let onError = opt$.onError === void 0 ? null : opt$.onError; 3579 let onError = opt$ && 'onError' in opt$ ? opt$.onError : null;
3580 let onDone = opt$.onDone === void 0 ? null : opt$.onDone; 3580 let onDone = opt$ && 'onDone' in opt$ ? opt$.onDone : null;
3581 let cancelOnError = opt$.cancelOnError === void 0 ? null : opt$.cancelOn Error; 3581 let cancelOnError = opt$ && 'cancelOnError' in opt$ ? opt$.cancelOnError : null;
3582 cancelOnError = core.identical(true, cancelOnError); 3582 cancelOnError = core.identical(true, cancelOnError);
3583 return this[_createSubscription](onData, onError, onDone, cancelOnError) ; 3583 return this[_createSubscription](onData, onError, onDone, cancelOnError) ;
3584 } 3584 }
3585 [_createSubscription](onData, onError, onDone, cancelOnError) { 3585 [_createSubscription](onData, onError, onDone, cancelOnError) {
3586 return new _ForwardingStreamSubscription(this, onData, onError, onDone, cancelOnError); 3586 return new _ForwardingStreamSubscription(this, onData, onError, onDone, cancelOnError);
3587 } 3587 }
3588 [_handleData](data, sink) { 3588 [_handleData](data, sink) {
3589 let outputData = data; 3589 let outputData = data;
3590 sink._add(outputData); 3590 sink._add(outputData);
3591 } 3591 }
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
4033 class _BoundSinkStream extends Stream$(T) { 4033 class _BoundSinkStream extends Stream$(T) {
4034 get isBroadcast() { 4034 get isBroadcast() {
4035 return this[_stream].isBroadcast; 4035 return this[_stream].isBroadcast;
4036 } 4036 }
4037 _BoundSinkStream($_stream, $_sinkMapper) { 4037 _BoundSinkStream($_stream, $_sinkMapper) {
4038 this[_stream] = $_stream; 4038 this[_stream] = $_stream;
4039 this[_sinkMapper] = $_sinkMapper; 4039 this[_sinkMapper] = $_sinkMapper;
4040 super.Stream(); 4040 super.Stream();
4041 } 4041 }
4042 listen(onData, opt$) { 4042 listen(onData, opt$) {
4043 let onError = opt$.onError === void 0 ? null : opt$.onError; 4043 let onError = opt$ && 'onError' in opt$ ? opt$.onError : null;
4044 let onDone = opt$.onDone === void 0 ? null : opt$.onDone; 4044 let onDone = opt$ && 'onDone' in opt$ ? opt$.onDone : null;
4045 let cancelOnError = opt$.cancelOnError === void 0 ? null : opt$.cancelOn Error; 4045 let cancelOnError = opt$ && 'cancelOnError' in opt$ ? opt$.cancelOnError : null;
4046 cancelOnError = core.identical(true, cancelOnError); 4046 cancelOnError = core.identical(true, cancelOnError);
4047 let subscription = dart.as(new _SinkTransformerStreamSubscription(this[_ stream], dart.closureWrap(this[_sinkMapper], "(EventSink<dynamic>) → EventSink") , onData, onError, onDone, cancelOnError), StreamSubscription$(T)); 4047 let subscription = dart.as(new _SinkTransformerStreamSubscription(this[_ stream], dart.closureWrap(this[_sinkMapper], "(EventSink<dynamic>) → EventSink") , onData, onError, onDone, cancelOnError), StreamSubscription$(T));
4048 return subscription; 4048 return subscription;
4049 } 4049 }
4050 } 4050 }
4051 return _BoundSinkStream; 4051 return _BoundSinkStream;
4052 }); 4052 });
4053 let _BoundSinkStream = _BoundSinkStream$(dart.dynamic, dart.dynamic); 4053 let _BoundSinkStream = _BoundSinkStream$(dart.dynamic, dart.dynamic);
4054 let _HandlerEventSink$ = dart.generic(function(S, T) { 4054 let _HandlerEventSink$ = dart.generic(function(S, T) {
4055 class _HandlerEventSink extends core.Object { 4055 class _HandlerEventSink extends core.Object {
(...skipping 17 matching lines...) Expand all
4073 } 4073 }
4074 return _HandlerEventSink; 4074 return _HandlerEventSink;
4075 }); 4075 });
4076 let _HandlerEventSink = _HandlerEventSink$(dart.dynamic, dart.dynamic); 4076 let _HandlerEventSink = _HandlerEventSink$(dart.dynamic, dart.dynamic);
4077 let _defaultHandleData = Symbol('_defaultHandleData'); 4077 let _defaultHandleData = Symbol('_defaultHandleData');
4078 let _defaultHandleError = Symbol('_defaultHandleError'); 4078 let _defaultHandleError = Symbol('_defaultHandleError');
4079 let _defaultHandleDone = Symbol('_defaultHandleDone'); 4079 let _defaultHandleDone = Symbol('_defaultHandleDone');
4080 let _StreamHandlerTransformer$ = dart.generic(function(S, T) { 4080 let _StreamHandlerTransformer$ = dart.generic(function(S, T) {
4081 class _StreamHandlerTransformer extends _StreamSinkTransformer$(S, T) { 4081 class _StreamHandlerTransformer extends _StreamSinkTransformer$(S, T) {
4082 _StreamHandlerTransformer(opt$) { 4082 _StreamHandlerTransformer(opt$) {
4083 let handleData = opt$.handleData === void 0 ? null : opt$.handleData; 4083 let handleData = opt$ && 'handleData' in opt$ ? opt$.handleData : null;
4084 let handleError = opt$.handleError === void 0 ? null : opt$.handleError; 4084 let handleError = opt$ && 'handleError' in opt$ ? opt$.handleError : nul l;
4085 let handleDone = opt$.handleDone === void 0 ? null : opt$.handleDone; 4085 let handleDone = opt$ && 'handleDone' in opt$ ? opt$.handleDone : null;
4086 super._StreamSinkTransformer(dart.closureWrap((outputSink) => { 4086 super._StreamSinkTransformer(dart.closureWrap((outputSink) => {
4087 if (handleData === null) 4087 if (handleData === null)
4088 handleData = dart.closureWrap(_defaultHandleData, "(S, EventSink<T>) → void"); 4088 handleData = dart.closureWrap(_defaultHandleData, "(S, EventSink<T>) → void");
4089 if (handleError === null) 4089 if (handleError === null)
4090 handleError = dart.closureWrap(_defaultHandleError, "(Object, StackT race, EventSink<T>) → void"); 4090 handleError = dart.closureWrap(_defaultHandleError, "(Object, StackT race, EventSink<T>) → void");
4091 if (handleDone === null) 4091 if (handleDone === null)
4092 handleDone = _defaultHandleDone; 4092 handleDone = _defaultHandleDone;
4093 return new _HandlerEventSink(handleData, handleError, handleDone, outp utSink); 4093 return new _HandlerEventSink(handleData, handleError, handleDone, outp utSink);
4094 }, "(EventSink<T>) → EventSink<S>")); 4094 }, "(EventSink<T>) → EventSink<S>"));
4095 } 4095 }
(...skipping 27 matching lines...) Expand all
4123 }); 4123 });
4124 let _StreamSubscriptionTransformer = _StreamSubscriptionTransformer$(dart.dyna mic, dart.dynamic); 4124 let _StreamSubscriptionTransformer = _StreamSubscriptionTransformer$(dart.dyna mic, dart.dynamic);
4125 let _BoundSubscriptionStream$ = dart.generic(function(S, T) { 4125 let _BoundSubscriptionStream$ = dart.generic(function(S, T) {
4126 class _BoundSubscriptionStream extends Stream$(T) { 4126 class _BoundSubscriptionStream extends Stream$(T) {
4127 _BoundSubscriptionStream($_stream, $_transformer) { 4127 _BoundSubscriptionStream($_stream, $_transformer) {
4128 this[_stream] = $_stream; 4128 this[_stream] = $_stream;
4129 this[_transformer] = $_transformer; 4129 this[_transformer] = $_transformer;
4130 super.Stream(); 4130 super.Stream();
4131 } 4131 }
4132 listen(onData, opt$) { 4132 listen(onData, opt$) {
4133 let onError = opt$.onError === void 0 ? null : opt$.onError; 4133 let onError = opt$ && 'onError' in opt$ ? opt$.onError : null;
4134 let onDone = opt$.onDone === void 0 ? null : opt$.onDone; 4134 let onDone = opt$ && 'onDone' in opt$ ? opt$.onDone : null;
4135 let cancelOnError = opt$.cancelOnError === void 0 ? null : opt$.cancelOn Error; 4135 let cancelOnError = opt$ && 'cancelOnError' in opt$ ? opt$.cancelOnError : null;
4136 cancelOnError = core.identical(true, cancelOnError); 4136 cancelOnError = core.identical(true, cancelOnError);
4137 let result = this[_transformer](this[_stream], cancelOnError); 4137 let result = this[_transformer](this[_stream], cancelOnError);
4138 result.onData(onData); 4138 result.onData(onData);
4139 result.onError(onError); 4139 result.onError(onError);
4140 result.onDone(onDone); 4140 result.onDone(onDone);
4141 return result; 4141 return result;
4142 } 4142 }
4143 } 4143 }
4144 return _BoundSubscriptionStream; 4144 return _BoundSubscriptionStream;
4145 }); 4145 });
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
4180 _ZoneFunction(zone, function) { 4180 _ZoneFunction(zone, function) {
4181 this.zone = zone; 4181 this.zone = zone;
4182 this['function'] = function; 4182 this['function'] = function;
4183 } 4183 }
4184 } 4184 }
4185 class ZoneSpecification extends core.Object { 4185 class ZoneSpecification extends core.Object {
4186 ZoneSpecification(opt$) { 4186 ZoneSpecification(opt$) {
4187 return new _ZoneSpecification(opt$); 4187 return new _ZoneSpecification(opt$);
4188 } 4188 }
4189 ZoneSpecification$from(other, opt$) { 4189 ZoneSpecification$from(other, opt$) {
4190 let handleUncaughtError = opt$.handleUncaughtError === void 0 ? null : opt $.handleUncaughtError; 4190 let handleUncaughtError = opt$ && 'handleUncaughtError' in opt$ ? opt$.han dleUncaughtError : null;
4191 let run = opt$.run === void 0 ? null : opt$.run; 4191 let run = opt$ && 'run' in opt$ ? opt$.run : null;
4192 let runUnary = opt$.runUnary === void 0 ? null : opt$.runUnary; 4192 let runUnary = opt$ && 'runUnary' in opt$ ? opt$.runUnary : null;
4193 let runBinary = opt$.runBinary === void 0 ? null : opt$.runBinary; 4193 let runBinary = opt$ && 'runBinary' in opt$ ? opt$.runBinary : null;
4194 let registerCallback = opt$.registerCallback === void 0 ? null : opt$.regi sterCallback; 4194 let registerCallback = opt$ && 'registerCallback' in opt$ ? opt$.registerC allback : null;
4195 let registerUnaryCallback = opt$.registerUnaryCallback === void 0 ? null : opt$.registerUnaryCallback; 4195 let registerUnaryCallback = opt$ && 'registerUnaryCallback' in opt$ ? opt$ .registerUnaryCallback : null;
4196 let registerBinaryCallback = opt$.registerBinaryCallback === void 0 ? null : opt$.registerBinaryCallback; 4196 let registerBinaryCallback = opt$ && 'registerBinaryCallback' in opt$ ? op t$.registerBinaryCallback : null;
4197 let errorCallback = opt$.errorCallback === void 0 ? null : opt$.errorCallb ack; 4197 let errorCallback = opt$ && 'errorCallback' in opt$ ? opt$.errorCallback : null;
4198 let scheduleMicrotask = opt$.scheduleMicrotask === void 0 ? null : opt$.sc heduleMicrotask; 4198 let scheduleMicrotask = opt$ && 'scheduleMicrotask' in opt$ ? opt$.schedul eMicrotask : null;
4199 let createTimer = opt$.createTimer === void 0 ? null : opt$.createTimer; 4199 let createTimer = opt$ && 'createTimer' in opt$ ? opt$.createTimer : null;
4200 let createPeriodicTimer = opt$.createPeriodicTimer === void 0 ? null : opt $.createPeriodicTimer; 4200 let createPeriodicTimer = opt$ && 'createPeriodicTimer' in opt$ ? opt$.cre atePeriodicTimer : null;
4201 let print = opt$.print === void 0 ? null : opt$.print; 4201 let print = opt$ && 'print' in opt$ ? opt$.print : null;
4202 let fork = opt$.fork === void 0 ? null : opt$.fork; 4202 let fork = opt$ && 'fork' in opt$ ? opt$.fork : null;
4203 return new ZoneSpecification({handleUncaughtError: dart.as(handleUncaughtE rror !== null ? handleUncaughtError : other.handleUncaughtError, dart.throw_("Un implemented type (Zone, ZoneDelegate, Zone, dynamic, StackTrace) → dynamic")), r un: dart.as(run !== null ? run : other.run, dart.throw_("Unimplemented type (Zon e, ZoneDelegate, Zone, () → dynamic) → dynamic")), runUnary: dart.as(runUnary != = null ? runUnary : other.runUnary, dart.throw_("Unimplemented type (Zone, ZoneD elegate, Zone, (dynamic) → dynamic, dynamic) → dynamic")), runBinary: dart.as(ru nBinary !== null ? runBinary : other.runBinary, dart.throw_("Unimplemented type (Zone, ZoneDelegate, Zone, (dynamic, dynamic) → dynamic, dynamic, dynamic) → dyn amic")), registerCallback: dart.as(registerCallback !== null ? registerCallback : other.registerCallback, dart.throw_("Unimplemented type (Zone, ZoneDelegate, Z one, () → dynamic) → ZoneCallback")), registerUnaryCallback: dart.as(registerUna ryCallback !== null ? registerUnaryCallback : other.registerUnaryCallback, dart. throw_("Unimplemented type (Zone, ZoneDelegate, Zone, (dynamic) → dynamic) → Zon eUnaryCallback")), registerBinaryCallback: dart.as(registerBinaryCallback !== nu ll ? registerBinaryCallback : other.registerBinaryCallback, dart.throw_("Unimple mented type (Zone, ZoneDelegate, Zone, (dynamic, dynamic) → dynamic) → ZoneBinar yCallback")), errorCallback: dart.as(errorCallback !== null ? errorCallback : ot her.errorCallback, dart.throw_("Unimplemented type (Zone, ZoneDelegate, Zone, Ob ject, StackTrace) → AsyncError")), scheduleMicrotask: dart.as(scheduleMicrotask !== null ? scheduleMicrotask : other.scheduleMicrotask, dart.throw_("Unimplement ed type (Zone, ZoneDelegate, Zone, () → dynamic) → void")), createTimer: dart.as (createTimer !== null ? createTimer : other.createTimer, dart.throw_("Unimplemen ted type (Zone, ZoneDelegate, Zone, Duration, () → void) → Timer")), createPerio dicTimer: dart.as(createPeriodicTimer !== null ? createPeriodicTimer : other.cre atePeriodicTimer, dart.throw_("Unimplemented type (Zone, ZoneDelegate, Zone, Dur ation, (Timer) → void) → Timer")), print: dart.as(print !== null ? print : other .print, dart.throw_("Unimplemented type (Zone, ZoneDelegate, Zone, String) → voi d")), fork: dart.as(fork !== null ? fork : other.fork, dart.throw_("Unimplemente d type (Zone, ZoneDelegate, Zone, ZoneSpecification, Map<dynamic, dynamic>) → Zo ne"))}); 4203 return new ZoneSpecification({handleUncaughtError: dart.as(handleUncaughtE rror !== null ? handleUncaughtError : other.handleUncaughtError, dart.throw_("Un implemented type (Zone, ZoneDelegate, Zone, dynamic, StackTrace) → dynamic")), r un: dart.as(run !== null ? run : other.run, dart.throw_("Unimplemented type (Zon e, ZoneDelegate, Zone, () → dynamic) → dynamic")), runUnary: dart.as(runUnary != = null ? runUnary : other.runUnary, dart.throw_("Unimplemented type (Zone, ZoneD elegate, Zone, (dynamic) → dynamic, dynamic) → dynamic")), runBinary: dart.as(ru nBinary !== null ? runBinary : other.runBinary, dart.throw_("Unimplemented type (Zone, ZoneDelegate, Zone, (dynamic, dynamic) → dynamic, dynamic, dynamic) → dyn amic")), registerCallback: dart.as(registerCallback !== null ? registerCallback : other.registerCallback, dart.throw_("Unimplemented type (Zone, ZoneDelegate, Z one, () → dynamic) → ZoneCallback")), registerUnaryCallback: dart.as(registerUna ryCallback !== null ? registerUnaryCallback : other.registerUnaryCallback, dart. throw_("Unimplemented type (Zone, ZoneDelegate, Zone, (dynamic) → dynamic) → Zon eUnaryCallback")), registerBinaryCallback: dart.as(registerBinaryCallback !== nu ll ? registerBinaryCallback : other.registerBinaryCallback, dart.throw_("Unimple mented type (Zone, ZoneDelegate, Zone, (dynamic, dynamic) → dynamic) → ZoneBinar yCallback")), errorCallback: dart.as(errorCallback !== null ? errorCallback : ot her.errorCallback, dart.throw_("Unimplemented type (Zone, ZoneDelegate, Zone, Ob ject, StackTrace) → AsyncError")), scheduleMicrotask: dart.as(scheduleMicrotask !== null ? scheduleMicrotask : other.scheduleMicrotask, dart.throw_("Unimplement ed type (Zone, ZoneDelegate, Zone, () → dynamic) → void")), createTimer: dart.as (createTimer !== null ? createTimer : other.createTimer, dart.throw_("Unimplemen ted type (Zone, ZoneDelegate, Zone, Duration, () → void) → Timer")), createPerio dicTimer: dart.as(createPeriodicTimer !== null ? createPeriodicTimer : other.cre atePeriodicTimer, dart.throw_("Unimplemented type (Zone, ZoneDelegate, Zone, Dur ation, (Timer) → void) → Timer")), print: dart.as(print !== null ? print : other .print, dart.throw_("Unimplemented type (Zone, ZoneDelegate, Zone, String) → voi d")), fork: dart.as(fork !== null ? fork : other.fork, dart.throw_("Unimplemente d type (Zone, ZoneDelegate, Zone, ZoneSpecification, Map<dynamic, dynamic>) → Zo ne"))});
4204 } 4204 }
4205 } 4205 }
4206 dart.defineNamedConstructor(ZoneSpecification, 'from'); 4206 dart.defineNamedConstructor(ZoneSpecification, 'from');
4207 class _ZoneSpecification extends core.Object { 4207 class _ZoneSpecification extends core.Object {
4208 _ZoneSpecification(opt$) { 4208 _ZoneSpecification(opt$) {
4209 let handleUncaughtError = opt$.handleUncaughtError === void 0 ? null : opt $.handleUncaughtError; 4209 let handleUncaughtError = opt$ && 'handleUncaughtError' in opt$ ? opt$.han dleUncaughtError : null;
4210 let run = opt$.run === void 0 ? null : opt$.run; 4210 let run = opt$ && 'run' in opt$ ? opt$.run : null;
4211 let runUnary = opt$.runUnary === void 0 ? null : opt$.runUnary; 4211 let runUnary = opt$ && 'runUnary' in opt$ ? opt$.runUnary : null;
4212 let runBinary = opt$.runBinary === void 0 ? null : opt$.runBinary; 4212 let runBinary = opt$ && 'runBinary' in opt$ ? opt$.runBinary : null;
4213 let registerCallback = opt$.registerCallback === void 0 ? null : opt$.regi sterCallback; 4213 let registerCallback = opt$ && 'registerCallback' in opt$ ? opt$.registerC allback : null;
4214 let registerUnaryCallback = opt$.registerUnaryCallback === void 0 ? null : opt$.registerUnaryCallback; 4214 let registerUnaryCallback = opt$ && 'registerUnaryCallback' in opt$ ? opt$ .registerUnaryCallback : null;
4215 let registerBinaryCallback = opt$.registerBinaryCallback === void 0 ? null : opt$.registerBinaryCallback; 4215 let registerBinaryCallback = opt$ && 'registerBinaryCallback' in opt$ ? op t$.registerBinaryCallback : null;
4216 let errorCallback = opt$.errorCallback === void 0 ? null : opt$.errorCallb ack; 4216 let errorCallback = opt$ && 'errorCallback' in opt$ ? opt$.errorCallback : null;
4217 let scheduleMicrotask = opt$.scheduleMicrotask === void 0 ? null : opt$.sc heduleMicrotask; 4217 let scheduleMicrotask = opt$ && 'scheduleMicrotask' in opt$ ? opt$.schedul eMicrotask : null;
4218 let createTimer = opt$.createTimer === void 0 ? null : opt$.createTimer; 4218 let createTimer = opt$ && 'createTimer' in opt$ ? opt$.createTimer : null;
4219 let createPeriodicTimer = opt$.createPeriodicTimer === void 0 ? null : opt $.createPeriodicTimer; 4219 let createPeriodicTimer = opt$ && 'createPeriodicTimer' in opt$ ? opt$.cre atePeriodicTimer : null;
4220 let print = opt$.print === void 0 ? null : opt$.print; 4220 let print = opt$ && 'print' in opt$ ? opt$.print : null;
4221 let fork = opt$.fork === void 0 ? null : opt$.fork; 4221 let fork = opt$ && 'fork' in opt$ ? opt$.fork : null;
4222 this.handleUncaughtError = handleUncaughtError; 4222 this.handleUncaughtError = handleUncaughtError;
4223 this.run = run; 4223 this.run = run;
4224 this.runUnary = runUnary; 4224 this.runUnary = runUnary;
4225 this.runBinary = runBinary; 4225 this.runBinary = runBinary;
4226 this.registerCallback = registerCallback; 4226 this.registerCallback = registerCallback;
4227 this.registerUnaryCallback = registerUnaryCallback; 4227 this.registerUnaryCallback = registerUnaryCallback;
4228 this.registerBinaryCallback = registerBinaryCallback; 4228 this.registerBinaryCallback = registerBinaryCallback;
4229 this.errorCallback = errorCallback; 4229 this.errorCallback = errorCallback;
4230 this.scheduleMicrotask = scheduleMicrotask; 4230 this.scheduleMicrotask = scheduleMicrotask;
4231 this.createTimer = createTimer; 4231 this.createTimer = createTimer;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
4422 runBinaryGuarded(f, arg1, arg2) { 4422 runBinaryGuarded(f, arg1, arg2) {
4423 try { 4423 try {
4424 return this.runBinary(f, arg1, arg2); 4424 return this.runBinary(f, arg1, arg2);
4425 } catch (e) { 4425 } catch (e) {
4426 let s = dart.stackTrace(e); 4426 let s = dart.stackTrace(e);
4427 return this.handleUncaughtError(e, s); 4427 return this.handleUncaughtError(e, s);
4428 } 4428 }
4429 4429
4430 } 4430 }
4431 bindCallback(f, opt$) { 4431 bindCallback(f, opt$) {
4432 let runGuarded = opt$.runGuarded === void 0 ? true : opt$.runGuarded; 4432 let runGuarded = opt$ && 'runGuarded' in opt$ ? opt$.runGuarded : true;
4433 let registered = this.registerCallback(f); 4433 let registered = this.registerCallback(f);
4434 if (runGuarded) { 4434 if (runGuarded) {
4435 return (() => this.runGuarded(registered)).bind(this); 4435 return (() => this.runGuarded(registered)).bind(this);
4436 } else { 4436 } else {
4437 return (() => this.run(registered)).bind(this); 4437 return (() => this.run(registered)).bind(this);
4438 } 4438 }
4439 } 4439 }
4440 bindUnaryCallback(f, opt$) { 4440 bindUnaryCallback(f, opt$) {
4441 let runGuarded = opt$.runGuarded === void 0 ? true : opt$.runGuarded; 4441 let runGuarded = opt$ && 'runGuarded' in opt$ ? opt$.runGuarded : true;
4442 let registered = this.registerUnaryCallback(f); 4442 let registered = this.registerUnaryCallback(f);
4443 if (runGuarded) { 4443 if (runGuarded) {
4444 return ((arg) => this.runUnaryGuarded(registered, arg)).bind(this); 4444 return ((arg) => this.runUnaryGuarded(registered, arg)).bind(this);
4445 } else { 4445 } else {
4446 return ((arg) => this.runUnary(registered, arg)).bind(this); 4446 return ((arg) => this.runUnary(registered, arg)).bind(this);
4447 } 4447 }
4448 } 4448 }
4449 bindBinaryCallback(f, opt$) { 4449 bindBinaryCallback(f, opt$) {
4450 let runGuarded = opt$.runGuarded === void 0 ? true : opt$.runGuarded; 4450 let runGuarded = opt$ && 'runGuarded' in opt$ ? opt$.runGuarded : true;
4451 let registered = this.registerBinaryCallback(f); 4451 let registered = this.registerBinaryCallback(f);
4452 if (runGuarded) { 4452 if (runGuarded) {
4453 return ((arg1, arg2) => this.runBinaryGuarded(registered, arg1, arg2)).b ind(this); 4453 return ((arg1, arg2) => this.runBinaryGuarded(registered, arg1, arg2)).b ind(this);
4454 } else { 4454 } else {
4455 return ((arg1, arg2) => this.runBinary(registered, arg1, arg2)).bind(thi s); 4455 return ((arg1, arg2) => this.runBinary(registered, arg1, arg2)).bind(thi s);
4456 } 4456 }
4457 } 4457 }
4458 get(key) { 4458 get(key) {
4459 let result = this[_map].get(key); 4459 let result = this[_map].get(key);
4460 if (dart.notNull(result !== null) || dart.notNull(this[_map].containsKey(k ey))) 4460 if (dart.notNull(result !== null) || dart.notNull(this[_map].containsKey(k ey)))
4461 return result; 4461 return result;
4462 if (this.parent !== null) { 4462 if (this.parent !== null) {
4463 let value = this.parent.get(key); 4463 let value = this.parent.get(key);
4464 if (value !== null) { 4464 if (value !== null) {
4465 this[_map].set(key, value); 4465 this[_map].set(key, value);
4466 } 4466 }
4467 return value; 4467 return value;
4468 } 4468 }
4469 dart.assert(dart.equals(this, _ROOT_ZONE)); 4469 dart.assert(dart.equals(this, _ROOT_ZONE));
4470 return null; 4470 return null;
4471 } 4471 }
4472 handleUncaughtError(error, stackTrace) { 4472 handleUncaughtError(error, stackTrace) {
4473 let implementation = this[_handleUncaughtError]; 4473 let implementation = this[_handleUncaughtError];
4474 dart.assert(implementation !== null); 4474 dart.assert(implementation !== null);
4475 let parentDelegate = _parentDelegate(implementation.zone); 4475 let parentDelegate = _parentDelegate(implementation.zone);
4476 return dart.dinvokef(implementation['function'], implementation.zone, pare ntDelegate, this, error, stackTrace); 4476 return dart.dinvokef(implementation['function'], implementation.zone, pare ntDelegate, this, error, stackTrace);
4477 } 4477 }
4478 fork(opt$) { 4478 fork(opt$) {
4479 let specification = opt$.specification === void 0 ? null : opt$.specificat ion; 4479 let specification = opt$ && 'specification' in opt$ ? opt$.specification : null;
4480 let zoneValues = opt$.zoneValues === void 0 ? null : opt$.zoneValues; 4480 let zoneValues = opt$ && 'zoneValues' in opt$ ? opt$.zoneValues : null;
4481 let implementation = this[_fork]; 4481 let implementation = this[_fork];
4482 dart.assert(implementation !== null); 4482 dart.assert(implementation !== null);
4483 let parentDelegate = _parentDelegate(implementation.zone); 4483 let parentDelegate = _parentDelegate(implementation.zone);
4484 return dart.as(dart.dinvokef(implementation['function'], implementation.zo ne, parentDelegate, this, specification, zoneValues), Zone); 4484 return dart.as(dart.dinvokef(implementation['function'], implementation.zo ne, parentDelegate, this, specification, zoneValues), Zone);
4485 } 4485 }
4486 run(f) { 4486 run(f) {
4487 let implementation = this[_run]; 4487 let implementation = this[_run];
4488 dart.assert(implementation !== null); 4488 dart.assert(implementation !== null);
4489 let parentDelegate = _parentDelegate(implementation.zone); 4489 let parentDelegate = _parentDelegate(implementation.zone);
4490 return dart.dinvokef(implementation['function'], implementation.zone, pare ntDelegate, this, f); 4490 return dart.dinvokef(implementation['function'], implementation.zone, pare ntDelegate, this, f);
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
4786 return dart.dinvokef(f, arg1, arg2); 4786 return dart.dinvokef(f, arg1, arg2);
4787 } 4787 }
4788 return _rootRunBinary(null, null, this, f, arg1, arg2); 4788 return _rootRunBinary(null, null, this, f, arg1, arg2);
4789 } catch (e) { 4789 } catch (e) {
4790 let s = dart.stackTrace(e); 4790 let s = dart.stackTrace(e);
4791 return this.handleUncaughtError(e, s); 4791 return this.handleUncaughtError(e, s);
4792 } 4792 }
4793 4793
4794 } 4794 }
4795 bindCallback(f, opt$) { 4795 bindCallback(f, opt$) {
4796 let runGuarded = opt$.runGuarded === void 0 ? true : opt$.runGuarded; 4796 let runGuarded = opt$ && 'runGuarded' in opt$ ? opt$.runGuarded : true;
4797 if (runGuarded) { 4797 if (runGuarded) {
4798 return (() => this.runGuarded(f)).bind(this); 4798 return (() => this.runGuarded(f)).bind(this);
4799 } else { 4799 } else {
4800 return (() => this.run(f)).bind(this); 4800 return (() => this.run(f)).bind(this);
4801 } 4801 }
4802 } 4802 }
4803 bindUnaryCallback(f, opt$) { 4803 bindUnaryCallback(f, opt$) {
4804 let runGuarded = opt$.runGuarded === void 0 ? true : opt$.runGuarded; 4804 let runGuarded = opt$ && 'runGuarded' in opt$ ? opt$.runGuarded : true;
4805 if (runGuarded) { 4805 if (runGuarded) {
4806 return ((arg) => this.runUnaryGuarded(f, arg)).bind(this); 4806 return ((arg) => this.runUnaryGuarded(f, arg)).bind(this);
4807 } else { 4807 } else {
4808 return ((arg) => this.runUnary(f, arg)).bind(this); 4808 return ((arg) => this.runUnary(f, arg)).bind(this);
4809 } 4809 }
4810 } 4810 }
4811 bindBinaryCallback(f, opt$) { 4811 bindBinaryCallback(f, opt$) {
4812 let runGuarded = opt$.runGuarded === void 0 ? true : opt$.runGuarded; 4812 let runGuarded = opt$ && 'runGuarded' in opt$ ? opt$.runGuarded : true;
4813 if (runGuarded) { 4813 if (runGuarded) {
4814 return ((arg1, arg2) => this.runBinaryGuarded(f, arg1, arg2)).bind(this) ; 4814 return ((arg1, arg2) => this.runBinaryGuarded(f, arg1, arg2)).bind(this) ;
4815 } else { 4815 } else {
4816 return ((arg1, arg2) => this.runBinary(f, arg1, arg2)).bind(this); 4816 return ((arg1, arg2) => this.runBinary(f, arg1, arg2)).bind(this);
4817 } 4817 }
4818 } 4818 }
4819 get(key) { 4819 get(key) {
4820 return null; 4820 return null;
4821 } 4821 }
4822 handleUncaughtError(error, stackTrace) { 4822 handleUncaughtError(error, stackTrace) {
4823 return _rootHandleUncaughtError(null, null, this, error, stackTrace); 4823 return _rootHandleUncaughtError(null, null, this, error, stackTrace);
4824 } 4824 }
4825 fork(opt$) { 4825 fork(opt$) {
4826 let specification = opt$.specification === void 0 ? null : opt$.specificat ion; 4826 let specification = opt$ && 'specification' in opt$ ? opt$.specification : null;
4827 let zoneValues = opt$.zoneValues === void 0 ? null : opt$.zoneValues; 4827 let zoneValues = opt$ && 'zoneValues' in opt$ ? opt$.zoneValues : null;
4828 return _rootFork(null, null, this, specification, zoneValues); 4828 return _rootFork(null, null, this, specification, zoneValues);
4829 } 4829 }
4830 run(f) { 4830 run(f) {
4831 if (core.identical(Zone[_current], _ROOT_ZONE)) 4831 if (core.identical(Zone[_current], _ROOT_ZONE))
4832 return f(); 4832 return f();
4833 return _rootRun(null, null, this, f); 4833 return _rootRun(null, null, this, f);
4834 } 4834 }
4835 runUnary(f, arg) { 4835 runUnary(f, arg) {
4836 if (core.identical(Zone[_current], _ROOT_ZONE)) 4836 if (core.identical(Zone[_current], _ROOT_ZONE))
4837 return dart.dinvokef(f, arg); 4837 return dart.dinvokef(f, arg);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
4870 _RootZone._rootDelegate = null; 4870 _RootZone._rootDelegate = null;
4871 dart.defineLazyProperties(_RootZone, { 4871 dart.defineLazyProperties(_RootZone, {
4872 get _rootMap() { 4872 get _rootMap() {
4873 return new collection.HashMap(); 4873 return new collection.HashMap();
4874 }, 4874 },
4875 set _rootMap(_) {} 4875 set _rootMap(_) {}
4876 }); 4876 });
4877 let _ROOT_ZONE = new _RootZone(); 4877 let _ROOT_ZONE = new _RootZone();
4878 // Function runZoned: (() → dynamic, {zoneValues: Map<dynamic, dynamic>, zoneS pecification: ZoneSpecification, onError: Function}) → dynamic 4878 // Function runZoned: (() → dynamic, {zoneValues: Map<dynamic, dynamic>, zoneS pecification: ZoneSpecification, onError: Function}) → dynamic
4879 function runZoned(body, opt$) { 4879 function runZoned(body, opt$) {
4880 let zoneValues = opt$.zoneValues === void 0 ? null : opt$.zoneValues; 4880 let zoneValues = opt$ && 'zoneValues' in opt$ ? opt$.zoneValues : null;
4881 let zoneSpecification = opt$.zoneSpecification === void 0 ? null : opt$.zone Specification; 4881 let zoneSpecification = opt$ && 'zoneSpecification' in opt$ ? opt$.zoneSpeci fication : null;
4882 let onError = opt$.onError === void 0 ? null : opt$.onError; 4882 let onError = opt$ && 'onError' in opt$ ? opt$.onError : null;
4883 let errorHandler = null; 4883 let errorHandler = null;
4884 if (onError !== null) { 4884 if (onError !== null) {
4885 errorHandler = (self, parent, zone, error, stackTrace) => { 4885 errorHandler = (self, parent, zone, error, stackTrace) => {
4886 try { 4886 try {
4887 if (dart.is(onError, ZoneBinaryCallback)) { 4887 if (dart.is(onError, ZoneBinaryCallback)) {
4888 return self.parent.runBinary(onError, error, stackTrace); 4888 return self.parent.runBinary(onError, error, stackTrace);
4889 } 4889 }
4890 return self.parent.runUnary(dart.as(onError, dart.throw_("Unimplemente d type (dynamic) → dynamic")), error); 4890 return self.parent.runUnary(dart.as(onError, dart.throw_("Unimplemente d type (dynamic) → dynamic")), error);
4891 } catch (e) { 4891 } catch (e) {
4892 let s = dart.stackTrace(e); 4892 let s = dart.stackTrace(e);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
4943 exports.StreamIterator = StreamIterator; 4943 exports.StreamIterator = StreamIterator;
4944 exports.StreamIterator$ = StreamIterator$; 4944 exports.StreamIterator$ = StreamIterator$;
4945 exports.StreamController = StreamController; 4945 exports.StreamController = StreamController;
4946 exports.StreamController$ = StreamController$; 4946 exports.StreamController$ = StreamController$;
4947 exports.Timer = Timer; 4947 exports.Timer = Timer;
4948 exports.ZoneSpecification = ZoneSpecification; 4948 exports.ZoneSpecification = ZoneSpecification;
4949 exports.ZoneDelegate = ZoneDelegate; 4949 exports.ZoneDelegate = ZoneDelegate;
4950 exports.Zone = Zone; 4950 exports.Zone = Zone;
4951 exports.runZoned = runZoned; 4951 exports.runZoned = runZoned;
4952 })(async || (async = {})); 4952 })(async || (async = {}));
OLDNEW
« no previous file with comments | « lib/runtime/dart/_native_typed_data.js ('k') | lib/runtime/dart/collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698