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

Side by Side Diff: test/codegen/expect/dart/async.js

Issue 977613002: Make int and double nullable by default (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: actually upload changes 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
OLDNEW
1 var async; 1 var async;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 dart.copyProperties(exports, { 4 dart.copyProperties(exports, {
5 get _hasDocument() { 5 get _hasDocument() {
6 return dart.equals(typeof document, 'object'); 6 return dart.equals(typeof document, 'object');
7 } 7 }
8 }); 8 });
9 // Function _invokeErrorHandler: (Function, Object, StackTrace) → dynamic 9 // Function _invokeErrorHandler: (Function, Object, StackTrace) → dynamic
10 function _invokeErrorHandler(errorHandler, error, stackTrace) { 10 function _invokeErrorHandler(errorHandler, error, stackTrace) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 let _expectsEvent = Symbol('_expectsEvent'); 68 let _expectsEvent = Symbol('_expectsEvent');
69 let _toggleEventId = Symbol('_toggleEventId'); 69 let _toggleEventId = Symbol('_toggleEventId');
70 let _isFiring = Symbol('_isFiring'); 70 let _isFiring = Symbol('_isFiring');
71 let _setRemoveAfterFiring = Symbol('_setRemoveAfterFiring'); 71 let _setRemoveAfterFiring = Symbol('_setRemoveAfterFiring');
72 let _removeAfterFiring = Symbol('_removeAfterFiring'); 72 let _removeAfterFiring = Symbol('_removeAfterFiring');
73 let _onPause = Symbol('_onPause'); 73 let _onPause = Symbol('_onPause');
74 let _onResume = Symbol('_onResume'); 74 let _onResume = Symbol('_onResume');
75 let _BroadcastSubscription$ = dart.generic(function(T) { 75 let _BroadcastSubscription$ = dart.generic(function(T) {
76 class _BroadcastSubscription extends _ControllerSubscription$(T) { 76 class _BroadcastSubscription extends _ControllerSubscription$(T) {
77 _BroadcastSubscription(controller, onData, onError, onDone, cancelOnError) { 77 _BroadcastSubscription(controller, onData, onError, onDone, cancelOnError) {
78 this[_eventState] = dart.as(null, core.int); 78 this[_eventState] = null;
79 this[_next] = null; 79 this[_next] = null;
80 this[_previous] = null; 80 this[_previous] = null;
81 super._ControllerSubscription(dart.as(controller, _StreamControllerLifec ycle$(T)), onData, onError, onDone, cancelOnError); 81 super._ControllerSubscription(dart.as(controller, _StreamControllerLifec ycle$(T)), onData, onError, onDone, cancelOnError);
82 this[_next] = this[_previous] = this; 82 this[_next] = this[_previous] = this;
83 } 83 }
84 get [_controller]() { 84 get [_controller]() {
85 return dart.as(super[_controller], _BroadcastStreamController); 85 return dart.as(super[_controller], _BroadcastStreamController);
86 } 86 }
87 [_expectsEvent](eventId) { 87 [_expectsEvent](eventId) {
88 return (this[_eventState] & _STATE_EVENT_ID) === eventId; 88 return (dart.notNull(this[_eventState]) & dart.notNull(_STATE_EVENT_ID)) === eventId;
89 } 89 }
90 [_toggleEventId]() { 90 [_toggleEventId]() {
91 this[_eventState] = _STATE_EVENT_ID; 91 this[_eventState] = _STATE_EVENT_ID;
92 } 92 }
93 get [_isFiring]() { 93 get [_isFiring]() {
94 return (this[_eventState] & _STATE_FIRING) !== 0; 94 return (dart.notNull(this[_eventState]) & dart.notNull(_STATE_FIRING)) ! == 0;
95 } 95 }
96 [_setRemoveAfterFiring]() { 96 [_setRemoveAfterFiring]() {
97 dart.assert(this[_isFiring]); 97 dart.assert(this[_isFiring]);
98 this[_eventState] = _STATE_REMOVE_AFTER_FIRING; 98 this[_eventState] = _STATE_REMOVE_AFTER_FIRING;
99 } 99 }
100 get [_removeAfterFiring]() { 100 get [_removeAfterFiring]() {
101 return (this[_eventState] & _STATE_REMOVE_AFTER_FIRING) !== 0; 101 return (dart.notNull(this[_eventState]) & dart.notNull(_STATE_REMOVE_AFT ER_FIRING)) !== 0;
102 } 102 }
103 [_onPause]() {} 103 [_onPause]() {}
104 [_onResume]() {} 104 [_onResume]() {}
105 } 105 }
106 _BroadcastSubscription._STATE_EVENT_ID = 1; 106 _BroadcastSubscription._STATE_EVENT_ID = 1;
107 _BroadcastSubscription._STATE_FIRING = 2; 107 _BroadcastSubscription._STATE_FIRING = 2;
108 _BroadcastSubscription._STATE_REMOVE_AFTER_FIRING = 4; 108 _BroadcastSubscription._STATE_REMOVE_AFTER_FIRING = 4;
109 return _BroadcastSubscription; 109 return _BroadcastSubscription;
110 }); 110 });
111 let _BroadcastSubscription = _BroadcastSubscription$(dynamic); 111 let _BroadcastSubscription = _BroadcastSubscription$(dynamic);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 this[_doneFuture] = null; 148 this[_doneFuture] = null;
149 this[_next] = this[_previous] = this; 149 this[_next] = this[_previous] = this;
150 } 150 }
151 get stream() { 151 get stream() {
152 return new _BroadcastStream(this); 152 return new _BroadcastStream(this);
153 } 153 }
154 get sink() { 154 get sink() {
155 return new _StreamSinkWrapper(this); 155 return new _StreamSinkWrapper(this);
156 } 156 }
157 get isClosed() { 157 get isClosed() {
158 return (this[_state] & _STATE_CLOSED) !== 0; 158 return (dart.notNull(this[_state]) & dart.notNull(_STATE_CLOSED)) !== 0;
159 } 159 }
160 get isPaused() { 160 get isPaused() {
161 return false; 161 return false;
162 } 162 }
163 get hasListener() { 163 get hasListener() {
164 return !dart.notNull(this[_isEmpty]); 164 return !dart.notNull(this[_isEmpty]);
165 } 165 }
166 get [_hasOneListener]() { 166 get [_hasOneListener]() {
167 dart.assert(!dart.notNull(this[_isEmpty])); 167 dart.assert(!dart.notNull(this[_isEmpty]));
168 return core.identical(this[_next][_next], this); 168 return core.identical(this[_next][_next], this);
169 } 169 }
170 get [_isFiring]() { 170 get [_isFiring]() {
171 return (this[_state] & _STATE_FIRING) !== 0; 171 return (dart.notNull(this[_state]) & dart.notNull(_STATE_FIRING)) !== 0;
172 } 172 }
173 get [_isAddingStream]() { 173 get [_isAddingStream]() {
174 return (this[_state] & _STATE_ADDSTREAM) !== 0; 174 return (dart.notNull(this[_state]) & dart.notNull(_STATE_ADDSTREAM)) !== 0;
175 } 175 }
176 get [_mayAddEvent]() { 176 get [_mayAddEvent]() {
177 return this[_state] < _STATE_CLOSED; 177 return dart.notNull(this[_state]) < dart.notNull(_STATE_CLOSED);
178 } 178 }
179 [_ensureDoneFuture]() { 179 [_ensureDoneFuture]() {
180 if (this[_doneFuture] !== null) 180 if (this[_doneFuture] !== null)
181 return this[_doneFuture]; 181 return this[_doneFuture];
182 return this[_doneFuture] = new _Future(); 182 return this[_doneFuture] = new _Future();
183 } 183 }
184 get [_isEmpty]() { 184 get [_isEmpty]() {
185 return core.identical(this[_next], this); 185 return core.identical(this[_next], this);
186 } 186 }
187 [_addListener](subscription) { 187 [_addListener](subscription) {
188 dart.assert(core.identical(subscription[_next], subscription)); 188 dart.assert(core.identical(subscription[_next], subscription));
189 subscription[_previous] = this[_previous]; 189 subscription[_previous] = this[_previous];
190 subscription[_next] = this; 190 subscription[_next] = this;
191 this[_previous][_next] = subscription; 191 this[_previous][_next] = subscription;
192 this[_previous] = subscription; 192 this[_previous] = subscription;
193 subscription[_eventState] = this[_state] & _STATE_EVENT_ID; 193 subscription[_eventState] = dart.notNull(this[_state]) & dart.notNull(_S TATE_EVENT_ID);
194 } 194 }
195 [_removeListener](subscription) { 195 [_removeListener](subscription) {
196 dart.assert(core.identical(subscription[_controller], this)); 196 dart.assert(core.identical(subscription[_controller], this));
197 dart.assert(!dart.notNull(core.identical(subscription[_next], subscripti on))); 197 dart.assert(!dart.notNull(core.identical(subscription[_next], subscripti on)));
198 let previous = subscription[_previous]; 198 let previous = subscription[_previous];
199 let next = subscription[_next]; 199 let next = subscription[_next];
200 previous[_next] = next; 200 previous[_next] = next;
201 next[_previous] = previous; 201 next[_previous] = previous;
202 subscription[_next] = subscription[_previous] = subscription; 202 subscription[_next] = subscription[_previous] = subscription;
203 } 203 }
(...skipping 12 matching lines...) Expand all
216 } 216 }
217 [_recordCancel](subscription) { 217 [_recordCancel](subscription) {
218 if (core.identical(subscription[_next], subscription)) 218 if (core.identical(subscription[_next], subscription))
219 return null; 219 return null;
220 dart.assert(!dart.notNull(core.identical(subscription[_next], subscripti on))); 220 dart.assert(!dart.notNull(core.identical(subscription[_next], subscripti on)));
221 if (subscription[_isFiring]) { 221 if (subscription[_isFiring]) {
222 subscription._setRemoveAfterFiring(); 222 subscription._setRemoveAfterFiring();
223 } else { 223 } else {
224 dart.assert(!dart.notNull(core.identical(subscription[_next], subscrip tion))); 224 dart.assert(!dart.notNull(core.identical(subscription[_next], subscrip tion)));
225 this[_removeListener](subscription); 225 this[_removeListener](subscription);
226 if (dart.notNull(!dart.notNull(this[_isFiring])) && dart.notNull(this[ _isEmpty])) { 226 if (!dart.notNull(this[_isFiring]) && dart.notNull(this[_isEmpty])) {
227 this[_callOnCancel](); 227 this[_callOnCancel]();
228 } 228 }
229 } 229 }
230 return null; 230 return null;
231 } 231 }
232 [_recordPause](subscription) {} 232 [_recordPause](subscription) {}
233 [_recordResume](subscription) {} 233 [_recordResume](subscription) {}
234 [_addEventError]() { 234 [_addEventError]() {
235 if (this.isClosed) { 235 if (this.isClosed) {
236 return new core.StateError("Cannot add new events after calling close" ); 236 return new core.StateError("Cannot add new events after calling close" );
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 [_add](data) { 282 [_add](data) {
283 this[_sendData](data); 283 this[_sendData](data);
284 } 284 }
285 [_addError](error, stackTrace) { 285 [_addError](error, stackTrace) {
286 this[_sendError](error, stackTrace); 286 this[_sendError](error, stackTrace);
287 } 287 }
288 [_close]() { 288 [_close]() {
289 dart.assert(this[_isAddingStream]); 289 dart.assert(this[_isAddingStream]);
290 let addState = this[_addStreamState]; 290 let addState = this[_addStreamState];
291 this[_addStreamState] = null; 291 this[_addStreamState] = null;
292 this[_state] = ~_STATE_ADDSTREAM; 292 this[_state] = ~dart.notNull(_STATE_ADDSTREAM);
293 addState.complete(); 293 addState.complete();
294 } 294 }
295 [_forEachListener](action) { 295 [_forEachListener](action) {
296 if (this[_isFiring]) { 296 if (this[_isFiring]) {
297 throw new core.StateError("Cannot fire new event. Controller is alread y firing an event"); 297 throw new core.StateError("Cannot fire new event. Controller is alread y firing an event");
298 } 298 }
299 if (this[_isEmpty]) 299 if (this[_isEmpty])
300 return; 300 return;
301 let id = this[_state] & _STATE_EVENT_ID; 301 let id = dart.notNull(this[_state]) & dart.notNull(_STATE_EVENT_ID);
302 this[_state] = _STATE_EVENT_ID | _STATE_FIRING; 302 this[_state] = dart.notNull(_STATE_EVENT_ID) | dart.notNull(_STATE_FIRIN G);
303 let link = this[_next]; 303 let link = this[_next];
304 while (!dart.notNull(core.identical(link, this))) { 304 while (!dart.notNull(core.identical(link, this))) {
305 let subscription = dart.as(link, _BroadcastSubscription$(T)); 305 let subscription = dart.as(link, _BroadcastSubscription$(T));
306 if (subscription._expectsEvent(id)) { 306 if (subscription._expectsEvent(id)) {
307 subscription[_eventState] = _BroadcastSubscription[_STATE_FIRING]; 307 subscription[_eventState] = _BroadcastSubscription[_STATE_FIRING];
308 action(subscription); 308 action(subscription);
309 subscription._toggleEventId(); 309 subscription._toggleEventId();
310 link = subscription[_next]; 310 link = subscription[_next];
311 if (subscription[_removeAfterFiring]) { 311 if (subscription[_removeAfterFiring]) {
312 this[_removeListener](subscription); 312 this[_removeListener](subscription);
313 } 313 }
314 subscription[_eventState] = ~_BroadcastSubscription[_STATE_FIRING]; 314 subscription[_eventState] = ~dart.notNull(_BroadcastSubscription[_ST ATE_FIRING]);
315 } else { 315 } else {
316 link = subscription[_next]; 316 link = subscription[_next];
317 } 317 }
318 } 318 }
319 this[_state] = ~_STATE_FIRING; 319 this[_state] = ~dart.notNull(_STATE_FIRING);
320 if (this[_isEmpty]) { 320 if (this[_isEmpty]) {
321 this[_callOnCancel](); 321 this[_callOnCancel]();
322 } 322 }
323 } 323 }
324 [_callOnCancel]() { 324 [_callOnCancel]() {
325 dart.assert(this[_isEmpty]); 325 dart.assert(this[_isEmpty]);
326 if (dart.notNull(this.isClosed) && dart.notNull(this[_doneFuture][_mayCo mplete])) { 326 if (dart.notNull(this.isClosed) && dart.notNull(this[_doneFuture][_mayCo mplete])) {
327 this[_doneFuture]._asyncComplete(null); 327 this[_doneFuture]._asyncComplete(null);
328 } 328 }
329 _runGuarded(this[_onCancel]); 329 _runGuarded(this[_onCancel]);
(...skipping 12 matching lines...) Expand all
342 _SyncBroadcastStreamController(onListen, onCancel) { 342 _SyncBroadcastStreamController(onListen, onCancel) {
343 super._BroadcastStreamController(onListen, onCancel); 343 super._BroadcastStreamController(onListen, onCancel);
344 } 344 }
345 [_sendData](data) { 345 [_sendData](data) {
346 if (this[_isEmpty]) 346 if (this[_isEmpty])
347 return; 347 return;
348 if (this[_hasOneListener]) { 348 if (this[_hasOneListener]) {
349 this[_state] = _BroadcastStreamController[_STATE_FIRING]; 349 this[_state] = _BroadcastStreamController[_STATE_FIRING];
350 let subscription = dart.as(this[_next], _BroadcastSubscription); 350 let subscription = dart.as(this[_next], _BroadcastSubscription);
351 subscription._add(data); 351 subscription._add(data);
352 this[_state] = ~_BroadcastStreamController[_STATE_FIRING]; 352 this[_state] = ~dart.notNull(_BroadcastStreamController[_STATE_FIRING] );
353 if (this[_isEmpty]) { 353 if (this[_isEmpty]) {
354 this[_callOnCancel](); 354 this[_callOnCancel]();
355 } 355 }
356 return; 356 return;
357 } 357 }
358 this[_forEachListener](((subscription) => { 358 this[_forEachListener](((subscription) => {
359 subscription._add(data); 359 subscription._add(data);
360 }).bind(this)); 360 }).bind(this));
361 } 361 }
362 [_sendError](error, stackTrace) { 362 [_sendError](error, stackTrace) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 let _hasPending = Symbol('_hasPending'); 418 let _hasPending = Symbol('_hasPending');
419 let _addPendingEvent = Symbol('_addPendingEvent'); 419 let _addPendingEvent = Symbol('_addPendingEvent');
420 let _STATE_CLOSED = Symbol('_STATE_CLOSED'); 420 let _STATE_CLOSED = Symbol('_STATE_CLOSED');
421 let _AsBroadcastStreamController$ = dart.generic(function(T) { 421 let _AsBroadcastStreamController$ = dart.generic(function(T) {
422 class _AsBroadcastStreamController extends _SyncBroadcastStreamController$(T ) { 422 class _AsBroadcastStreamController extends _SyncBroadcastStreamController$(T ) {
423 _AsBroadcastStreamController(onListen, onCancel) { 423 _AsBroadcastStreamController(onListen, onCancel) {
424 this[_pending] = null; 424 this[_pending] = null;
425 super._SyncBroadcastStreamController(onListen, onCancel); 425 super._SyncBroadcastStreamController(onListen, onCancel);
426 } 426 }
427 get [_hasPending]() { 427 get [_hasPending]() {
428 return dart.notNull(this[_pending] !== null) && dart.notNull(!dart.notNu ll(this[_pending].isEmpty)); 428 return dart.notNull(this[_pending] !== null) && !dart.notNull(this[_pend ing].isEmpty);
429 } 429 }
430 [_addPendingEvent](event) { 430 [_addPendingEvent](event) {
431 if (this[_pending] === null) { 431 if (this[_pending] === null) {
432 this[_pending] = new _StreamImplEvents(); 432 this[_pending] = new _StreamImplEvents();
433 } 433 }
434 this[_pending].add(event); 434 this[_pending].add(event);
435 } 435 }
436 add(data) { 436 add(data) {
437 if (dart.notNull(!dart.notNull(this.isClosed)) && dart.notNull(this[_isF iring])) { 437 if (!dart.notNull(this.isClosed) && dart.notNull(this[_isFiring])) {
438 this[_addPendingEvent](new _DelayedData(data)); 438 this[_addPendingEvent](new _DelayedData(data));
439 return; 439 return;
440 } 440 }
441 super.add(data); 441 super.add(data);
442 while (this[_hasPending]) { 442 while (this[_hasPending]) {
443 this[_pending].handleNext(this); 443 this[_pending].handleNext(this);
444 } 444 }
445 } 445 }
446 addError(error, stackTrace) { 446 addError(error, stackTrace) {
447 if (stackTrace === void 0) 447 if (stackTrace === void 0)
448 stackTrace = null; 448 stackTrace = null;
449 if (dart.notNull(!dart.notNull(this.isClosed)) && dart.notNull(this[_isF iring])) { 449 if (!dart.notNull(this.isClosed) && dart.notNull(this[_isFiring])) {
450 this[_addPendingEvent](new _DelayedError(error, stackTrace)); 450 this[_addPendingEvent](new _DelayedError(error, stackTrace));
451 return; 451 return;
452 } 452 }
453 if (!dart.notNull(this[_mayAddEvent])) 453 if (!dart.notNull(this[_mayAddEvent]))
454 throw this[_addEventError](); 454 throw this[_addEventError]();
455 this[_sendError](error, stackTrace); 455 this[_sendError](error, stackTrace);
456 while (this[_hasPending]) { 456 while (this[_hasPending]) {
457 this[_pending].handleNext(this); 457 this[_pending].handleNext(this);
458 } 458 }
459 } 459 }
460 close() { 460 close() {
461 if (dart.notNull(!dart.notNull(this.isClosed)) && dart.notNull(this[_isF iring])) { 461 if (!dart.notNull(this.isClosed) && dart.notNull(this[_isFiring])) {
462 this[_addPendingEvent](new _DelayedDone()); 462 this[_addPendingEvent](new _DelayedDone());
463 this[_state] = _BroadcastStreamController[_STATE_CLOSED]; 463 this[_state] = _BroadcastStreamController[_STATE_CLOSED];
464 return super.done; 464 return super.done;
465 } 465 }
466 let result = super.close(); 466 let result = super.close();
467 dart.assert(!dart.notNull(this[_hasPending])); 467 dart.assert(!dart.notNull(this[_hasPending]));
468 return result; 468 return result;
469 } 469 }
470 [_callOnCancel]() { 470 [_callOnCancel]() {
471 if (this[_hasPending]) { 471 if (this[_hasPending]) {
(...skipping 14 matching lines...) Expand all
486 this[_pauseCount] = 0; 486 this[_pauseCount] = 0;
487 } 487 }
488 onData(handleData) {} 488 onData(handleData) {}
489 onError(handleError) {} 489 onError(handleError) {}
490 onDone(handleDone) {} 490 onDone(handleDone) {}
491 pause(resumeSignal) { 491 pause(resumeSignal) {
492 if (resumeSignal === void 0) 492 if (resumeSignal === void 0)
493 resumeSignal = null; 493 resumeSignal = null;
494 if (resumeSignal !== null) 494 if (resumeSignal !== null)
495 resumeSignal.then(this[_resume]); 495 resumeSignal.then(this[_resume]);
496 this[_pauseCount]++; 496 dart.notNull(this[_pauseCount])++;
497 } 497 }
498 resume() { 498 resume() {
499 this[_resume](null); 499 this[_resume](null);
500 } 500 }
501 [_resume](_) { 501 [_resume](_) {
502 if (this[_pauseCount] > 0) 502 if (dart.notNull(this[_pauseCount]) > 0)
503 this[_pauseCount]--; 503 dart.notNull(this[_pauseCount])--;
504 } 504 }
505 cancel() { 505 cancel() {
506 return new _Future.immediate(null); 506 return new _Future.immediate(null);
507 } 507 }
508 get isPaused() { 508 get isPaused() {
509 return this[_pauseCount] > 0; 509 return dart.notNull(this[_pauseCount]) > 0;
510 } 510 }
511 asFuture(value) { 511 asFuture(value) {
512 if (value === void 0) 512 if (value === void 0)
513 value = null; 513 value = null;
514 return new _Future(); 514 return new _Future();
515 } 515 }
516 } 516 }
517 return _DoneSubscription; 517 return _DoneSubscription;
518 }); 518 });
519 let _DoneSubscription = _DoneSubscription$(dynamic); 519 let _DoneSubscription = _DoneSubscription$(dynamic);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 static wait(futures, opt$) { 611 static wait(futures, opt$) {
612 let eagerError = opt$.eagerError === void 0 ? false : opt$.eagerError; 612 let eagerError = opt$.eagerError === void 0 ? false : opt$.eagerError;
613 let cleanUp = opt$.cleanUp === void 0 ? null : opt$.cleanUp; 613 let cleanUp = opt$.cleanUp === void 0 ? null : opt$.cleanUp;
614 let result = new _Future(); 614 let result = new _Future();
615 let values = null; 615 let values = null;
616 let remaining = 0; 616 let remaining = 0;
617 let error = null; 617 let error = null;
618 let stackTrace = null; 618 let stackTrace = null;
619 // Function handleError: (dynamic, dynamic) → void 619 // Function handleError: (dynamic, dynamic) → void
620 function handleError(theError, theStackTrace) { 620 function handleError(theError, theStackTrace) {
621 remaining--; 621 dart.notNull(remaining)--;
622 if (values !== null) { 622 if (values !== null) {
623 if (cleanUp !== null) { 623 if (cleanUp !== null) {
624 for (let value of values) { 624 for (let value of values) {
625 if (value !== null) { 625 if (value !== null) {
626 new Future.sync(() => { 626 new Future.sync(() => {
627 cleanUp(value); 627 cleanUp(value);
628 }); 628 });
629 } 629 }
630 } 630 }
631 } 631 }
632 values = null; 632 values = null;
633 if (dart.notNull(remaining === 0) || dart.notNull(eagerError)) { 633 if (remaining === 0 || dart.notNull(eagerError)) {
634 result._completeError(theError, dart.as(theStackTrace, core.StackT race)); 634 result._completeError(theError, dart.as(theStackTrace, core.StackT race));
635 } else { 635 } else {
636 error = theError; 636 error = theError;
637 stackTrace = dart.as(theStackTrace, core.StackTrace); 637 stackTrace = dart.as(theStackTrace, core.StackTrace);
638 } 638 }
639 } else if (dart.notNull(remaining === 0) && dart.notNull(!dart.notNull (eagerError))) { 639 } else if (remaining === 0 && !dart.notNull(eagerError)) {
640 result._completeError(error, stackTrace); 640 result._completeError(error, stackTrace);
641 } 641 }
642 } 642 }
643 for (let future of futures) { 643 for (let future of futures) {
644 let pos = remaining++; 644 let pos = dart.notNull(remaining)++;
645 future.then(dart.as(((value) => { 645 future.then(dart.as(((value) => {
646 remaining--; 646 dart.notNull(remaining)--;
647 if (values !== null) { 647 if (values !== null) {
648 values.set(pos, value); 648 values.set(pos, value);
649 if (remaining === 0) { 649 if (remaining === 0) {
650 result._completeWithValue(values); 650 result._completeWithValue(values);
651 } 651 }
652 } else { 652 } else {
653 if (dart.notNull(cleanUp !== null) && dart.notNull(value !== null) ) { 653 if (dart.notNull(cleanUp !== null) && dart.notNull(value !== null) ) {
654 new Future.sync(() => { 654 new Future.sync(() => {
655 cleanUp(value); 655 cleanUp(value);
656 }); 656 });
657 } 657 }
658 if (dart.notNull(remaining === 0) && dart.notNull(!dart.notNull(ea gerError))) { 658 if (remaining === 0 && !dart.notNull(eagerError)) {
659 result._completeError(error, stackTrace); 659 result._completeError(error, stackTrace);
660 } 660 }
661 } 661 }
662 }).bind(this), dart.throw_("Unimplemented type (dynamic) → dynamic")), {onError: handleError}); 662 }).bind(this), dart.throw_("Unimplemented type (dynamic) → dynamic")), {onError: handleError});
663 } 663 }
664 if (remaining === 0) { 664 if (remaining === 0) {
665 return dart.as(new Future.value(/* Unimplemented const */new List.from ([])), Future$(core.List)); 665 return dart.as(new Future.value(/* Unimplemented const */new List.from ([])), Future$(core.List));
666 } 666 }
667 values = new core.List(remaining); 667 values = new core.List(remaining);
668 return result; 668 return result;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 this.result = result; 833 this.result = result;
834 this.callback = null; 834 this.callback = null;
835 this.errorCallback = null; 835 this.errorCallback = null;
836 this.state = STATE_CHAIN; 836 this.state = STATE_CHAIN;
837 this[_nextListener] = null; 837 this[_nextListener] = null;
838 } 838 }
839 get [_zone]() { 839 get [_zone]() {
840 return this.result[_zone]; 840 return this.result[_zone];
841 } 841 }
842 get handlesValue() { 842 get handlesValue() {
843 return (this.state & MASK_VALUE) !== 0; 843 return (dart.notNull(this.state) & dart.notNull(MASK_VALUE)) !== 0;
844 } 844 }
845 get handlesError() { 845 get handlesError() {
846 return (this.state & MASK_ERROR) !== 0; 846 return (dart.notNull(this.state) & dart.notNull(MASK_ERROR)) !== 0;
847 } 847 }
848 get hasErrorTest() { 848 get hasErrorTest() {
849 return this.state === STATE_CATCHERROR_TEST; 849 return this.state === STATE_CATCHERROR_TEST;
850 } 850 }
851 get handlesComplete() { 851 get handlesComplete() {
852 return this.state === STATE_WHENCOMPLETE; 852 return this.state === STATE_WHENCOMPLETE;
853 } 853 }
854 get [_onValue]() { 854 get [_onValue]() {
855 dart.assert(this.handlesValue); 855 dart.assert(this.handlesValue);
856 return dart.as(this.callback, _FutureOnValue); 856 return dart.as(this.callback, _FutureOnValue);
(...skipping 13 matching lines...) Expand all
870 dart.defineNamedConstructor(_FutureListener, 'then'); 870 dart.defineNamedConstructor(_FutureListener, 'then');
871 dart.defineNamedConstructor(_FutureListener, 'catchError'); 871 dart.defineNamedConstructor(_FutureListener, 'catchError');
872 dart.defineNamedConstructor(_FutureListener, 'whenComplete'); 872 dart.defineNamedConstructor(_FutureListener, 'whenComplete');
873 dart.defineNamedConstructor(_FutureListener, 'chain'); 873 dart.defineNamedConstructor(_FutureListener, 'chain');
874 _FutureListener.MASK_VALUE = 1; 874 _FutureListener.MASK_VALUE = 1;
875 _FutureListener.MASK_ERROR = 2; 875 _FutureListener.MASK_ERROR = 2;
876 _FutureListener.MASK_TEST_ERROR = 4; 876 _FutureListener.MASK_TEST_ERROR = 4;
877 _FutureListener.MASK_WHENCOMPLETE = 8; 877 _FutureListener.MASK_WHENCOMPLETE = 8;
878 _FutureListener.STATE_CHAIN = 0; 878 _FutureListener.STATE_CHAIN = 0;
879 _FutureListener.STATE_THEN = MASK_VALUE; 879 _FutureListener.STATE_THEN = MASK_VALUE;
880 _FutureListener.STATE_THEN_ONERROR = MASK_VALUE | MASK_ERROR; 880 _FutureListener.STATE_THEN_ONERROR = dart.notNull(MASK_VALUE) | dart.notNull(M ASK_ERROR);
881 _FutureListener.STATE_CATCHERROR = MASK_ERROR; 881 _FutureListener.STATE_CATCHERROR = MASK_ERROR;
882 _FutureListener.STATE_CATCHERROR_TEST = MASK_ERROR | MASK_TEST_ERROR; 882 _FutureListener.STATE_CATCHERROR_TEST = dart.notNull(MASK_ERROR) | dart.notNul l(MASK_TEST_ERROR);
883 _FutureListener.STATE_WHENCOMPLETE = MASK_WHENCOMPLETE; 883 _FutureListener.STATE_WHENCOMPLETE = MASK_WHENCOMPLETE;
884 let _resultOrListeners = Symbol('_resultOrListeners'); 884 let _resultOrListeners = Symbol('_resultOrListeners');
885 let _asyncComplete = Symbol('_asyncComplete'); 885 let _asyncComplete = Symbol('_asyncComplete');
886 let _asyncCompleteError = Symbol('_asyncCompleteError'); 886 let _asyncCompleteError = Symbol('_asyncCompleteError');
887 let _isChained = Symbol('_isChained'); 887 let _isChained = Symbol('_isChained');
888 let _isComplete = Symbol('_isComplete'); 888 let _isComplete = Symbol('_isComplete');
889 let _hasValue = Symbol('_hasValue'); 889 let _hasValue = Symbol('_hasValue');
890 let _hasError = Symbol('_hasError'); 890 let _hasError = Symbol('_hasError');
891 let _markPendingCompletion = Symbol('_markPendingCompletion'); 891 let _markPendingCompletion = Symbol('_markPendingCompletion');
892 let _value = Symbol('_value'); 892 let _value = Symbol('_value');
(...skipping 28 matching lines...) Expand all
921 this[_resultOrListeners] = null; 921 this[_resultOrListeners] = null;
922 this[_asyncCompleteError](error, stackTrace); 922 this[_asyncCompleteError](error, stackTrace);
923 } 923 }
924 get [_mayComplete]() { 924 get [_mayComplete]() {
925 return this[_state] === _INCOMPLETE; 925 return this[_state] === _INCOMPLETE;
926 } 926 }
927 get [_isChained]() { 927 get [_isChained]() {
928 return this[_state] === _CHAINED; 928 return this[_state] === _CHAINED;
929 } 929 }
930 get [_isComplete]() { 930 get [_isComplete]() {
931 return this[_state] >= _VALUE; 931 return dart.notNull(this[_state]) >= dart.notNull(_VALUE);
932 } 932 }
933 get [_hasValue]() { 933 get [_hasValue]() {
934 return this[_state] === _VALUE; 934 return this[_state] === _VALUE;
935 } 935 }
936 get [_hasError]() { 936 get [_hasError]() {
937 return this[_state] === _ERROR; 937 return this[_state] === _ERROR;
938 } 938 }
939 set [_isChained](value) { 939 set [_isChained](value) {
940 if (value) { 940 if (value) {
941 dart.assert(!dart.notNull(this[_isComplete])); 941 dart.assert(!dart.notNull(this[_isComplete]));
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 let listener = listeners; 1132 let listener = listeners;
1133 listeners = listener[_nextListener]; 1133 listeners = listener[_nextListener];
1134 listener[_nextListener] = null; 1134 listener[_nextListener] = null;
1135 _propagateToListeners(source, listener); 1135 _propagateToListeners(source, listener);
1136 } 1136 }
1137 let listener = listeners; 1137 let listener = listeners;
1138 let listenerHasValue = true; 1138 let listenerHasValue = true;
1139 let sourceValue = hasError ? null : source[_value]; 1139 let sourceValue = hasError ? null : source[_value];
1140 let listenerValueOrError = sourceValue; 1140 let listenerValueOrError = sourceValue;
1141 let isPropagationAborted = false; 1141 let isPropagationAborted = false;
1142 if (dart.notNull(hasError) || dart.notNull(dart.notNull(listener.handl esValue) || dart.notNull(listener.handlesComplete))) { 1142 if (dart.notNull(hasError) || dart.notNull(listener.handlesValue) || d art.notNull(listener.handlesComplete)) {
1143 let zone = listener[_zone]; 1143 let zone = listener[_zone];
1144 if (dart.notNull(hasError) && dart.notNull(!dart.notNull(source[_zon e].inSameErrorZone(zone)))) { 1144 if (dart.notNull(hasError) && !dart.notNull(source[_zone].inSameErro rZone(zone))) {
1145 let asyncError = source[_error]; 1145 let asyncError = source[_error];
1146 source[_zone].handleUncaughtError(asyncError.error, asyncError.sta ckTrace); 1146 source[_zone].handleUncaughtError(asyncError.error, asyncError.sta ckTrace);
1147 return; 1147 return;
1148 } 1148 }
1149 let oldZone = null; 1149 let oldZone = null;
1150 if (!dart.notNull(core.identical(Zone.current, zone))) { 1150 if (!dart.notNull(core.identical(Zone.current, zone))) {
1151 oldZone = Zone._enter(zone); 1151 oldZone = Zone._enter(zone);
1152 } 1152 }
1153 // Function handleValueCallback: () → bool 1153 // Function handleValueCallback: () → bool
1154 function handleValueCallback() { 1154 function handleValueCallback() {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 } else { 1241 } else {
1242 handleError(); 1242 handleError();
1243 } 1243 }
1244 if (listener.handlesComplete) { 1244 if (listener.handlesComplete) {
1245 handleWhenCompleteCallback(); 1245 handleWhenCompleteCallback();
1246 } 1246 }
1247 if (oldZone !== null) 1247 if (oldZone !== null)
1248 Zone._leave(oldZone); 1248 Zone._leave(oldZone);
1249 if (isPropagationAborted) 1249 if (isPropagationAborted)
1250 return; 1250 return;
1251 if (dart.notNull(dart.notNull(listenerHasValue) && dart.notNull(!dar t.notNull(core.identical(sourceValue, listenerValueOrError)))) && dart.notNull(d art.is(listenerValueOrError, Future))) { 1251 if (dart.notNull(listenerHasValue) && !dart.notNull(core.identical(s ourceValue, listenerValueOrError)) && dart.notNull(dart.is(listenerValueOrError, Future))) {
1252 let chainSource = dart.as(listenerValueOrError, Future); 1252 let chainSource = dart.as(listenerValueOrError, Future);
1253 let result = listener.result; 1253 let result = listener.result;
1254 if (dart.is(chainSource, _Future)) { 1254 if (dart.is(chainSource, _Future)) {
1255 if (chainSource[_isComplete]) { 1255 if (chainSource[_isComplete]) {
1256 result[_isChained] = true; 1256 result[_isChained] = true;
1257 source = chainSource; 1257 source = chainSource;
1258 listeners = new _FutureListener.chain(result); 1258 listeners = new _FutureListener.chain(result);
1259 continue; 1259 continue;
1260 } else { 1260 } else {
1261 _chainCoreFuture(chainSource, result); 1261 _chainCoreFuture(chainSource, result);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 }).bind(this)}); 1480 }).bind(this)});
1481 return controller.stream; 1481 return controller.stream;
1482 } 1482 }
1483 Stream$fromIterable(data) { 1483 Stream$fromIterable(data) {
1484 return new _GeneratedStreamImpl(() => new _IterablePendingEvents(data)); 1484 return new _GeneratedStreamImpl(() => new _IterablePendingEvents(data));
1485 } 1485 }
1486 Stream$periodic(period, computation) { 1486 Stream$periodic(period, computation) {
1487 if (computation === void 0) 1487 if (computation === void 0)
1488 computation = null; 1488 computation = null;
1489 if (computation === null) 1489 if (computation === null)
1490 computation = dart.as((i) => null, dart.throw_("Unimplemented type (in t) → T")); 1490 computation = (i) => null;
1491 let timer = null; 1491 let timer = null;
1492 let computationCount = 0; 1492 let computationCount = 0;
1493 let controller = null; 1493 let controller = null;
1494 let watch = new core.Stopwatch(); 1494 let watch = new core.Stopwatch();
1495 // Function sendEvent: () → void 1495 // Function sendEvent: () → void
1496 function sendEvent() { 1496 function sendEvent() {
1497 watch.reset(); 1497 watch.reset();
1498 let data = computation(computationCount++); 1498 let data = computation(dart.notNull(computationCount)++);
1499 controller.add(data); 1499 controller.add(data);
1500 } 1500 }
1501 // Function startPeriodicTimer: () → void 1501 // Function startPeriodicTimer: () → void
1502 function startPeriodicTimer() { 1502 function startPeriodicTimer() {
1503 dart.assert(timer === null); 1503 dart.assert(timer === null);
1504 timer = new Timer.periodic(period, (timer) => { 1504 timer = new Timer.periodic(period, (timer) => {
1505 sendEvent(); 1505 sendEvent();
1506 }); 1506 });
1507 } 1507 }
1508 controller = new StreamController({sync: true, onListen: (() => { 1508 controller = new StreamController({sync: true, onListen: (() => {
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1758 }, dart.throw_("Unimplemented type (dynamic) → dynamic")), dart.as(_ca ncelAndErrorClosure(subscription, future), dart.throw_("Unimplemented type (dyna mic, StackTrace) → dynamic"))); 1758 }, dart.throw_("Unimplemented type (dynamic) → dynamic")), dart.as(_ca ncelAndErrorClosure(subscription, future), dart.throw_("Unimplemented type (dyna mic, StackTrace) → dynamic")));
1759 }, {onError: future[_completeError], onDone: (() => { 1759 }, {onError: future[_completeError], onDone: (() => {
1760 future._complete(false); 1760 future._complete(false);
1761 }).bind(this), cancelOnError: true}); 1761 }).bind(this), cancelOnError: true});
1762 return future; 1762 return future;
1763 } 1763 }
1764 get length() { 1764 get length() {
1765 let future = new _Future(); 1765 let future = new _Future();
1766 let count = 0; 1766 let count = 0;
1767 this.listen((_) => { 1767 this.listen((_) => {
1768 count++; 1768 dart.notNull(count)++;
1769 }, {onError: future[_completeError], onDone: (() => { 1769 }, {onError: future[_completeError], onDone: (() => {
1770 future._complete(count); 1770 future._complete(count);
1771 }).bind(this), cancelOnError: true}); 1771 }).bind(this), cancelOnError: true});
1772 return future; 1772 return future;
1773 } 1773 }
1774 get isEmpty() { 1774 get isEmpty() {
1775 let future = new _Future(); 1775 let future = new _Future();
1776 let subscription = null; 1776 let subscription = null;
1777 subscription = this.listen((_) => { 1777 subscription = this.listen((_) => {
1778 _cancelAndValue(subscription, future, false); 1778 _cancelAndValue(subscription, future, false);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1838 _completeWithErrorCallback(future, e, s); 1838 _completeWithErrorCallback(future, e, s);
1839 } 1839 }
1840 1840
1841 }, 1841 },
1842 cancelOnError: true 1842 cancelOnError: true
1843 }); 1843 });
1844 return future; 1844 return future;
1845 } 1845 }
1846 get last() { 1846 get last() {
1847 let future = new _Future(); 1847 let future = new _Future();
1848 let result = dart.as(null, T); 1848 let result = null;
1849 let foundResult = false; 1849 let foundResult = false;
1850 let subscription = null; 1850 let subscription = null;
1851 subscription = this.listen((value) => { 1851 subscription = this.listen((value) => {
1852 foundResult = true; 1852 foundResult = true;
1853 result = value; 1853 result = value;
1854 }, {onError: future[_completeError], onDone: (() => { 1854 }, {onError: future[_completeError], onDone: (() => {
1855 if (foundResult) { 1855 if (foundResult) {
1856 future._complete(result); 1856 future._complete(result);
1857 return; 1857 return;
1858 } 1858 }
1859 try { 1859 try {
1860 throw _internal.IterableElementError.noElement(); 1860 throw _internal.IterableElementError.noElement();
1861 } catch (e) { 1861 } catch (e) {
1862 let s = dart.stackTrace(e); 1862 let s = dart.stackTrace(e);
1863 _completeWithErrorCallback(future, e, s); 1863 _completeWithErrorCallback(future, e, s);
1864 } 1864 }
1865 1865
1866 }).bind(this), cancelOnError: true}); 1866 }).bind(this), cancelOnError: true});
1867 return future; 1867 return future;
1868 } 1868 }
1869 get single() { 1869 get single() {
1870 let future = new _Future(); 1870 let future = new _Future();
1871 let result = dart.as(null, T); 1871 let result = null;
1872 let foundResult = false; 1872 let foundResult = false;
1873 let subscription = null; 1873 let subscription = null;
1874 subscription = this.listen((value) => { 1874 subscription = this.listen((value) => {
1875 if (foundResult) { 1875 if (foundResult) {
1876 try { 1876 try {
1877 throw _internal.IterableElementError.tooMany(); 1877 throw _internal.IterableElementError.tooMany();
1878 } catch (e) { 1878 } catch (e) {
1879 let s = dart.stackTrace(e); 1879 let s = dart.stackTrace(e);
1880 _cancelAndErrorWithReplacement(subscription, future, e, s); 1880 _cancelAndErrorWithReplacement(subscription, future, e, s);
1881 } 1881 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1920 let s = dart.stackTrace(e); 1920 let s = dart.stackTrace(e);
1921 _completeWithErrorCallback(future, e, s); 1921 _completeWithErrorCallback(future, e, s);
1922 } 1922 }
1923 1923
1924 }).bind(this), cancelOnError: true}); 1924 }).bind(this), cancelOnError: true});
1925 return future; 1925 return future;
1926 } 1926 }
1927 lastWhere(test, opt$) { 1927 lastWhere(test, opt$) {
1928 let defaultValue = opt$.defaultValue === void 0 ? null : opt$.defaultVal ue; 1928 let defaultValue = opt$.defaultValue === void 0 ? null : opt$.defaultVal ue;
1929 let future = new _Future(); 1929 let future = new _Future();
1930 let result = dart.as(null, T); 1930 let result = null;
1931 let foundResult = false; 1931 let foundResult = false;
1932 let subscription = null; 1932 let subscription = null;
1933 subscription = this.listen((value) => { 1933 subscription = this.listen((value) => {
1934 _runUserCode(() => true === test(value), dart.as((isMatch) => { 1934 _runUserCode(() => true === test(value), dart.as((isMatch) => {
1935 if (isMatch) { 1935 if (isMatch) {
1936 foundResult = true; 1936 foundResult = true;
1937 result = value; 1937 result = value;
1938 } 1938 }
1939 }, dart.throw_("Unimplemented type (dynamic) → dynamic")), dart.as(_ca ncelAndErrorClosure(subscription, future), dart.throw_("Unimplemented type (dyna mic, StackTrace) → dynamic"))); 1939 }, dart.throw_("Unimplemented type (dynamic) → dynamic")), dart.as(_ca ncelAndErrorClosure(subscription, future), dart.throw_("Unimplemented type (dyna mic, StackTrace) → dynamic")));
1940 }, {onError: future[_completeError], onDone: (() => { 1940 }, {onError: future[_completeError], onDone: (() => {
(...skipping 10 matching lines...) Expand all
1951 } catch (e) { 1951 } catch (e) {
1952 let s = dart.stackTrace(e); 1952 let s = dart.stackTrace(e);
1953 _completeWithErrorCallback(future, e, s); 1953 _completeWithErrorCallback(future, e, s);
1954 } 1954 }
1955 1955
1956 }).bind(this), cancelOnError: true}); 1956 }).bind(this), cancelOnError: true});
1957 return future; 1957 return future;
1958 } 1958 }
1959 singleWhere(test) { 1959 singleWhere(test) {
1960 let future = new _Future(); 1960 let future = new _Future();
1961 let result = dart.as(null, T); 1961 let result = null;
1962 let foundResult = false; 1962 let foundResult = false;
1963 let subscription = null; 1963 let subscription = null;
1964 subscription = this.listen((value) => { 1964 subscription = this.listen((value) => {
1965 _runUserCode(() => true === test(value), dart.as((isMatch) => { 1965 _runUserCode(() => true === test(value), dart.as((isMatch) => {
1966 if (isMatch) { 1966 if (isMatch) {
1967 if (foundResult) { 1967 if (foundResult) {
1968 try { 1968 try {
1969 throw _internal.IterableElementError.tooMany(); 1969 throw _internal.IterableElementError.tooMany();
1970 } catch (e) { 1970 } catch (e) {
1971 let s = dart.stackTrace(e); 1971 let s = dart.stackTrace(e);
(...skipping 15 matching lines...) Expand all
1987 throw _internal.IterableElementError.noElement(); 1987 throw _internal.IterableElementError.noElement();
1988 } catch (e) { 1988 } catch (e) {
1989 let s = dart.stackTrace(e); 1989 let s = dart.stackTrace(e);
1990 _completeWithErrorCallback(future, e, s); 1990 _completeWithErrorCallback(future, e, s);
1991 } 1991 }
1992 1992
1993 }).bind(this), cancelOnError: true}); 1993 }).bind(this), cancelOnError: true});
1994 return future; 1994 return future;
1995 } 1995 }
1996 elementAt(index) { 1996 elementAt(index) {
1997 if (dart.notNull(!(typeof index == number)) || dart.notNull(index < 0)) 1997 if (dart.notNull(!(typeof index == number)) || dart.notNull(index) < 0)
1998 throw new core.ArgumentError(index); 1998 throw new core.ArgumentError(index);
1999 let future = new _Future(); 1999 let future = new _Future();
2000 let subscription = null; 2000 let subscription = null;
2001 let elementIndex = 0; 2001 let elementIndex = 0;
2002 subscription = this.listen((value) => { 2002 subscription = this.listen((value) => {
2003 if (index === elementIndex) { 2003 if (index === elementIndex) {
2004 _cancelAndValue(subscription, future, value); 2004 _cancelAndValue(subscription, future, value);
2005 return; 2005 return;
2006 } 2006 }
2007 elementIndex = 1; 2007 elementIndex = 1;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2171 }); 2171 });
2172 let _ControllerEventSinkWrapper = _ControllerEventSinkWrapper$(dynamic); 2172 let _ControllerEventSinkWrapper = _ControllerEventSinkWrapper$(dynamic);
2173 let StreamController$ = dart.generic(function(T) { 2173 let StreamController$ = dart.generic(function(T) {
2174 class StreamController extends dart.Object { 2174 class StreamController extends dart.Object {
2175 StreamController(opt$) { 2175 StreamController(opt$) {
2176 let onListen = opt$.onListen === void 0 ? null : opt$.onListen; 2176 let onListen = opt$.onListen === void 0 ? null : opt$.onListen;
2177 let onPause = opt$.onPause === void 0 ? null : opt$.onPause; 2177 let onPause = opt$.onPause === void 0 ? null : opt$.onPause;
2178 let onResume = opt$.onResume === void 0 ? null : opt$.onResume; 2178 let onResume = opt$.onResume === void 0 ? null : opt$.onResume;
2179 let onCancel = opt$.onCancel === void 0 ? null : opt$.onCancel; 2179 let onCancel = opt$.onCancel === void 0 ? null : opt$.onCancel;
2180 let sync = opt$.sync === void 0 ? false : opt$.sync; 2180 let sync = opt$.sync === void 0 ? false : opt$.sync;
2181 if (dart.notNull(dart.notNull(dart.notNull(onListen === null) && dart.no tNull(onPause === null)) && dart.notNull(onResume === null)) && dart.notNull(onC ancel === null)) { 2181 if (dart.notNull(onListen === null) && dart.notNull(onPause === null) && dart.notNull(onResume === null) && dart.notNull(onCancel === null)) {
2182 return dart.as(sync ? new _NoCallbackSyncStreamController() : new _NoC allbackAsyncStreamController(), StreamController$(T)); 2182 return dart.as(sync ? new _NoCallbackSyncStreamController() : new _NoC allbackAsyncStreamController(), StreamController$(T));
2183 } 2183 }
2184 return sync ? new _SyncStreamController(onListen, onPause, onResume, onC ancel) : new _AsyncStreamController(onListen, onPause, onResume, onCancel); 2184 return sync ? new _SyncStreamController(onListen, onPause, onResume, onC ancel) : new _AsyncStreamController(onListen, onPause, onResume, onCancel);
2185 } 2185 }
2186 StreamController$broadcast(opt$) { 2186 StreamController$broadcast(opt$) {
2187 let onListen = opt$.onListen === void 0 ? null : opt$.onListen; 2187 let onListen = opt$.onListen === void 0 ? null : opt$.onListen;
2188 let onCancel = opt$.onCancel === void 0 ? null : opt$.onCancel; 2188 let onCancel = opt$.onCancel === void 0 ? null : opt$.onCancel;
2189 let sync = opt$.sync === void 0 ? false : opt$.sync; 2189 let sync = opt$.sync === void 0 ? false : opt$.sync;
2190 return sync ? new _SyncBroadcastStreamController(onListen, onCancel) : n ew _AsyncBroadcastStreamController(onListen, onCancel); 2190 return sync ? new _SyncBroadcastStreamController(onListen, onCancel) : n ew _AsyncBroadcastStreamController(onListen, onCancel);
2191 } 2191 }
(...skipping 30 matching lines...) Expand all
2222 this[_state] = _STATE_INITIAL; 2222 this[_state] = _STATE_INITIAL;
2223 this[_doneFuture] = null; 2223 this[_doneFuture] = null;
2224 } 2224 }
2225 get stream() { 2225 get stream() {
2226 return dart.as(new _ControllerStream(this), Stream$(T)); 2226 return dart.as(new _ControllerStream(this), Stream$(T));
2227 } 2227 }
2228 get sink() { 2228 get sink() {
2229 return new _StreamSinkWrapper(this); 2229 return new _StreamSinkWrapper(this);
2230 } 2230 }
2231 get [_isCanceled]() { 2231 get [_isCanceled]() {
2232 return (this[_state] & _STATE_CANCELED) !== 0; 2232 return (dart.notNull(this[_state]) & dart.notNull(_STATE_CANCELED)) !== 0;
2233 } 2233 }
2234 get hasListener() { 2234 get hasListener() {
2235 return (this[_state] & _STATE_SUBSCRIBED) !== 0; 2235 return (dart.notNull(this[_state]) & dart.notNull(_STATE_SUBSCRIBED)) != = 0;
2236 } 2236 }
2237 get [_isInitialState]() { 2237 get [_isInitialState]() {
2238 return (this[_state] & _STATE_SUBSCRIPTION_MASK) === _STATE_INITIAL; 2238 return (dart.notNull(this[_state]) & dart.notNull(_STATE_SUBSCRIPTION_MA SK)) === _STATE_INITIAL;
2239 } 2239 }
2240 get isClosed() { 2240 get isClosed() {
2241 return (this[_state] & _STATE_CLOSED) !== 0; 2241 return (dart.notNull(this[_state]) & dart.notNull(_STATE_CLOSED)) !== 0;
2242 } 2242 }
2243 get isPaused() { 2243 get isPaused() {
2244 return this.hasListener ? this[_subscription][_isInputPaused] : !dart.no tNull(this[_isCanceled]); 2244 return this.hasListener ? this[_subscription][_isInputPaused] : !dart.no tNull(this[_isCanceled]);
2245 } 2245 }
2246 get [_isAddingStream]() { 2246 get [_isAddingStream]() {
2247 return (this[_state] & _STATE_ADDSTREAM) !== 0; 2247 return (dart.notNull(this[_state]) & dart.notNull(_STATE_ADDSTREAM)) !== 0;
2248 } 2248 }
2249 get [_mayAddEvent]() { 2249 get [_mayAddEvent]() {
2250 return this[_state] < _STATE_CLOSED; 2250 return dart.notNull(this[_state]) < dart.notNull(_STATE_CLOSED);
2251 } 2251 }
2252 get [_pendingEvents]() { 2252 get [_pendingEvents]() {
2253 dart.assert(this[_isInitialState]); 2253 dart.assert(this[_isInitialState]);
2254 if (!dart.notNull(this[_isAddingStream])) { 2254 if (!dart.notNull(this[_isAddingStream])) {
2255 return dart.as(this[_varData], _PendingEvents); 2255 return dart.as(this[_varData], _PendingEvents);
2256 } 2256 }
2257 let state = dart.as(this[_varData], _StreamControllerAddStreamState); 2257 let state = dart.as(this[_varData], _StreamControllerAddStreamState);
2258 return dart.as(state.varData, _PendingEvents); 2258 return dart.as(state.varData, _PendingEvents);
2259 } 2259 }
2260 [_ensurePendingEvents]() { 2260 [_ensurePendingEvents]() {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
2350 if (this.hasListener) { 2350 if (this.hasListener) {
2351 this[_sendError](error, stackTrace); 2351 this[_sendError](error, stackTrace);
2352 } else if (this[_isInitialState]) { 2352 } else if (this[_isInitialState]) {
2353 this[_ensurePendingEvents]().add(new _DelayedError(error, stackTrace)) ; 2353 this[_ensurePendingEvents]().add(new _DelayedError(error, stackTrace)) ;
2354 } 2354 }
2355 } 2355 }
2356 [_close]() { 2356 [_close]() {
2357 dart.assert(this[_isAddingStream]); 2357 dart.assert(this[_isAddingStream]);
2358 let addState = dart.as(this[_varData], _StreamControllerAddStreamState); 2358 let addState = dart.as(this[_varData], _StreamControllerAddStreamState);
2359 this[_varData] = addState.varData; 2359 this[_varData] = addState.varData;
2360 this[_state] = ~_STATE_ADDSTREAM; 2360 this[_state] = ~dart.notNull(_STATE_ADDSTREAM);
2361 addState.complete(); 2361 addState.complete();
2362 } 2362 }
2363 [_subscribe](onData, onError, onDone, cancelOnError) { 2363 [_subscribe](onData, onError, onDone, cancelOnError) {
2364 if (!dart.notNull(this[_isInitialState])) { 2364 if (!dart.notNull(this[_isInitialState])) {
2365 throw new core.StateError("Stream has already been listened to."); 2365 throw new core.StateError("Stream has already been listened to.");
2366 } 2366 }
2367 let subscription = new _ControllerSubscription(this, dart.as(onData, dar t.throw_("Unimplemented type (dynamic) → void")), onError, onDone, cancelOnError ); 2367 let subscription = new _ControllerSubscription(this, dart.as(onData, dar t.throw_("Unimplemented type (dynamic) → void")), onError, onDone, cancelOnError );
2368 let pendingEvents = this[_pendingEvents]; 2368 let pendingEvents = this[_pendingEvents];
2369 this[_state] = _STATE_SUBSCRIBED; 2369 this[_state] = _STATE_SUBSCRIBED;
2370 if (this[_isAddingStream]) { 2370 if (this[_isAddingStream]) {
2371 let addState = dart.as(this[_varData], _StreamControllerAddStreamState ); 2371 let addState = dart.as(this[_varData], _StreamControllerAddStreamState );
2372 addState.varData = subscription; 2372 addState.varData = subscription;
2373 addState.resume(); 2373 addState.resume();
2374 } else { 2374 } else {
2375 this[_varData] = subscription; 2375 this[_varData] = subscription;
2376 } 2376 }
2377 subscription._setPendingEvents(pendingEvents); 2377 subscription._setPendingEvents(pendingEvents);
2378 subscription._guardCallback((() => { 2378 subscription._guardCallback((() => {
2379 _runGuarded(this[_onListen]); 2379 _runGuarded(this[_onListen]);
2380 }).bind(this)); 2380 }).bind(this));
2381 return dart.as(subscription, StreamSubscription$(T)); 2381 return dart.as(subscription, StreamSubscription$(T));
2382 } 2382 }
2383 [_recordCancel](subscription) { 2383 [_recordCancel](subscription) {
2384 let result = null; 2384 let result = null;
2385 if (this[_isAddingStream]) { 2385 if (this[_isAddingStream]) {
2386 let addState = dart.as(this[_varData], _StreamControllerAddStreamState ); 2386 let addState = dart.as(this[_varData], _StreamControllerAddStreamState );
2387 result = addState.cancel(); 2387 result = addState.cancel();
2388 } 2388 }
2389 this[_varData] = null; 2389 this[_varData] = null;
2390 this[_state] = this[_state] & ~(_STATE_SUBSCRIBED | _STATE_ADDSTREAM) | _STATE_CANCELED; 2390 this[_state] = dart.notNull(this[_state]) & ~(dart.notNull(_STATE_SUBSCR IBED) | dart.notNull(_STATE_ADDSTREAM)) | dart.notNull(_STATE_CANCELED);
2391 if (this[_onCancel] !== null) { 2391 if (this[_onCancel] !== null) {
2392 if (result === null) { 2392 if (result === null) {
2393 try { 2393 try {
2394 result = dart.as(this[_onCancel](), Future); 2394 result = dart.as(this[_onCancel](), Future);
2395 } catch (e) { 2395 } catch (e) {
2396 let s = dart.stackTrace(e); 2396 let s = dart.stackTrace(e);
2397 result = ((_) => { 2397 result = ((_) => {
2398 _._asyncCompleteError(e, s); 2398 _._asyncCompleteError(e, s);
2399 return _; 2399 return _;
2400 }).bind(this)(new _Future()); 2400 }).bind(this)(new _Future());
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2534 let _ControllerStream$ = dart.generic(function(T) { 2534 let _ControllerStream$ = dart.generic(function(T) {
2535 class _ControllerStream extends _StreamImpl$(T) { 2535 class _ControllerStream extends _StreamImpl$(T) {
2536 _ControllerStream($_controller) { 2536 _ControllerStream($_controller) {
2537 this[_controller] = $_controller; 2537 this[_controller] = $_controller;
2538 super._StreamImpl(); 2538 super._StreamImpl();
2539 } 2539 }
2540 [_createSubscription](onData, onError, onDone, cancelOnError) { 2540 [_createSubscription](onData, onError, onDone, cancelOnError) {
2541 return this[_controller]._subscribe(onData, onError, onDone, cancelOnErr or); 2541 return this[_controller]._subscribe(onData, onError, onDone, cancelOnErr or);
2542 } 2542 }
2543 get hashCode() { 2543 get hashCode() {
2544 return this[_controller].hashCode ^ 892482866; 2544 return dart.notNull(this[_controller].hashCode) ^ 892482866;
2545 } 2545 }
2546 ['=='](other) { 2546 ['=='](other) {
2547 if (core.identical(this, other)) 2547 if (core.identical(this, other))
2548 return true; 2548 return true;
2549 if (!dart.is(other, _ControllerStream)) 2549 if (!dart.is(other, _ControllerStream))
2550 return false; 2550 return false;
2551 let otherStream = dart.as(other, _ControllerStream); 2551 let otherStream = dart.as(other, _ControllerStream);
2552 return core.identical(otherStream[_controller], this[_controller]); 2552 return core.identical(otherStream[_controller], this[_controller]);
2553 } 2553 }
2554 } 2554 }
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 handleDone = _nullDoneHandler; 2725 handleDone = _nullDoneHandler;
2726 this[_onDone] = this[_zone].registerCallback(handleDone); 2726 this[_onDone] = this[_zone].registerCallback(handleDone);
2727 } 2727 }
2728 pause(resumeSignal) { 2728 pause(resumeSignal) {
2729 if (resumeSignal === void 0) 2729 if (resumeSignal === void 0)
2730 resumeSignal = null; 2730 resumeSignal = null;
2731 if (this[_isCanceled]) 2731 if (this[_isCanceled])
2732 return; 2732 return;
2733 let wasPaused = this[_isPaused]; 2733 let wasPaused = this[_isPaused];
2734 let wasInputPaused = this[_isInputPaused]; 2734 let wasInputPaused = this[_isInputPaused];
2735 this[_state] = this[_state] + _STATE_PAUSE_COUNT | _STATE_INPUT_PAUSED; 2735 this[_state] = dart.notNull(this[_state]) + dart.notNull(_STATE_PAUSE_CO UNT) | dart.notNull(_STATE_INPUT_PAUSED);
2736 if (resumeSignal !== null) 2736 if (resumeSignal !== null)
2737 resumeSignal.whenComplete(this.resume); 2737 resumeSignal.whenComplete(this.resume);
2738 if (dart.notNull(!dart.notNull(wasPaused)) && dart.notNull(this[_pending ] !== null)) 2738 if (!dart.notNull(wasPaused) && dart.notNull(this[_pending] !== null))
2739 this[_pending].cancelSchedule(); 2739 this[_pending].cancelSchedule();
2740 if (dart.notNull(!dart.notNull(wasInputPaused)) && dart.notNull(!dart.no tNull(this[_inCallback]))) 2740 if (!dart.notNull(wasInputPaused) && !dart.notNull(this[_inCallback]))
2741 this[_guardCallback](this[_onPause]); 2741 this[_guardCallback](this[_onPause]);
2742 } 2742 }
2743 resume() { 2743 resume() {
2744 if (this[_isCanceled]) 2744 if (this[_isCanceled])
2745 return; 2745 return;
2746 if (this[_isPaused]) { 2746 if (this[_isPaused]) {
2747 this[_decrementPauseCount](); 2747 this[_decrementPauseCount]();
2748 if (!dart.notNull(this[_isPaused])) { 2748 if (!dart.notNull(this[_isPaused])) {
2749 if (dart.notNull(this[_hasPending]) && dart.notNull(!dart.notNull(th is[_pending].isEmpty))) { 2749 if (dart.notNull(this[_hasPending]) && !dart.notNull(this[_pending]. isEmpty)) {
2750 this[_pending].schedule(this); 2750 this[_pending].schedule(this);
2751 } else { 2751 } else {
2752 dart.assert(this[_mayResumeInput]); 2752 dart.assert(this[_mayResumeInput]);
2753 this[_state] = ~_STATE_INPUT_PAUSED; 2753 this[_state] = ~dart.notNull(_STATE_INPUT_PAUSED);
2754 if (!dart.notNull(this[_inCallback])) 2754 if (!dart.notNull(this[_inCallback]))
2755 this[_guardCallback](this[_onResume]); 2755 this[_guardCallback](this[_onResume]);
2756 } 2756 }
2757 } 2757 }
2758 } 2758 }
2759 } 2759 }
2760 cancel() { 2760 cancel() {
2761 this[_state] = ~_STATE_WAIT_FOR_CANCEL; 2761 this[_state] = ~dart.notNull(_STATE_WAIT_FOR_CANCEL);
2762 if (this[_isCanceled]) 2762 if (this[_isCanceled])
2763 return this[_cancelFuture]; 2763 return this[_cancelFuture];
2764 this[_cancel](); 2764 this[_cancel]();
2765 return this[_cancelFuture]; 2765 return this[_cancelFuture];
2766 } 2766 }
2767 asFuture(futureValue) { 2767 asFuture(futureValue) {
2768 if (futureValue === void 0) 2768 if (futureValue === void 0)
2769 futureValue = null; 2769 futureValue = null;
2770 let result = new _Future(); 2770 let result = new _Future();
2771 this[_onDone] = (() => { 2771 this[_onDone] = (() => {
2772 result._complete(futureValue); 2772 result._complete(futureValue);
2773 }).bind(this); 2773 }).bind(this);
2774 this[_onError] = ((error, stackTrace) => { 2774 this[_onError] = ((error, stackTrace) => {
2775 this.cancel(); 2775 this.cancel();
2776 result._completeError(error, dart.as(stackTrace, core.StackTrace)); 2776 result._completeError(error, dart.as(stackTrace, core.StackTrace));
2777 }).bind(this); 2777 }).bind(this);
2778 return result; 2778 return result;
2779 } 2779 }
2780 get [_isInputPaused]() { 2780 get [_isInputPaused]() {
2781 return (this[_state] & _STATE_INPUT_PAUSED) !== 0; 2781 return (dart.notNull(this[_state]) & dart.notNull(_STATE_INPUT_PAUSED)) !== 0;
2782 } 2782 }
2783 get [_isClosed]() { 2783 get [_isClosed]() {
2784 return (this[_state] & _STATE_CLOSED) !== 0; 2784 return (dart.notNull(this[_state]) & dart.notNull(_STATE_CLOSED)) !== 0;
2785 } 2785 }
2786 get [_isCanceled]() { 2786 get [_isCanceled]() {
2787 return (this[_state] & _STATE_CANCELED) !== 0; 2787 return (dart.notNull(this[_state]) & dart.notNull(_STATE_CANCELED)) !== 0;
2788 } 2788 }
2789 get [_waitsForCancel]() { 2789 get [_waitsForCancel]() {
2790 return (this[_state] & _STATE_WAIT_FOR_CANCEL) !== 0; 2790 return (dart.notNull(this[_state]) & dart.notNull(_STATE_WAIT_FOR_CANCEL )) !== 0;
2791 } 2791 }
2792 get [_inCallback]() { 2792 get [_inCallback]() {
2793 return (this[_state] & _STATE_IN_CALLBACK) !== 0; 2793 return (dart.notNull(this[_state]) & dart.notNull(_STATE_IN_CALLBACK)) ! == 0;
2794 } 2794 }
2795 get [_hasPending]() { 2795 get [_hasPending]() {
2796 return (this[_state] & _STATE_HAS_PENDING) !== 0; 2796 return (dart.notNull(this[_state]) & dart.notNull(_STATE_HAS_PENDING)) ! == 0;
2797 } 2797 }
2798 get [_isPaused]() { 2798 get [_isPaused]() {
2799 return this[_state] >= _STATE_PAUSE_COUNT; 2799 return dart.notNull(this[_state]) >= dart.notNull(_STATE_PAUSE_COUNT);
2800 } 2800 }
2801 get [_canFire]() { 2801 get [_canFire]() {
2802 return this[_state] < _STATE_IN_CALLBACK; 2802 return dart.notNull(this[_state]) < dart.notNull(_STATE_IN_CALLBACK);
2803 } 2803 }
2804 get [_mayResumeInput]() { 2804 get [_mayResumeInput]() {
2805 return dart.notNull(!dart.notNull(this[_isPaused])) && dart.notNull(dart .notNull(this[_pending] === null) || dart.notNull(this[_pending].isEmpty)); 2805 return !dart.notNull(this[_isPaused]) && (dart.notNull(this[_pending] == = null) || dart.notNull(this[_pending].isEmpty));
2806 } 2806 }
2807 get [_cancelOnError]() { 2807 get [_cancelOnError]() {
2808 return (this[_state] & _STATE_CANCEL_ON_ERROR) !== 0; 2808 return (dart.notNull(this[_state]) & dart.notNull(_STATE_CANCEL_ON_ERROR )) !== 0;
2809 } 2809 }
2810 get isPaused() { 2810 get isPaused() {
2811 return this[_isPaused]; 2811 return this[_isPaused];
2812 } 2812 }
2813 [_cancel]() { 2813 [_cancel]() {
2814 this[_state] = _STATE_CANCELED; 2814 this[_state] = _STATE_CANCELED;
2815 if (this[_hasPending]) { 2815 if (this[_hasPending]) {
2816 this[_pending].cancelSchedule(); 2816 this[_pending].cancelSchedule();
2817 } 2817 }
2818 if (!dart.notNull(this[_inCallback])) 2818 if (!dart.notNull(this[_inCallback]))
2819 this[_pending] = null; 2819 this[_pending] = null;
2820 this[_cancelFuture] = this[_onCancel](); 2820 this[_cancelFuture] = this[_onCancel]();
2821 } 2821 }
2822 [_incrementPauseCount]() { 2822 [_incrementPauseCount]() {
2823 this[_state] = this[_state] + _STATE_PAUSE_COUNT | _STATE_INPUT_PAUSED; 2823 this[_state] = dart.notNull(this[_state]) + dart.notNull(_STATE_PAUSE_CO UNT) | dart.notNull(_STATE_INPUT_PAUSED);
2824 } 2824 }
2825 [_decrementPauseCount]() { 2825 [_decrementPauseCount]() {
2826 dart.assert(this[_isPaused]); 2826 dart.assert(this[_isPaused]);
2827 this[_state] = _STATE_PAUSE_COUNT; 2827 this[_state] = _STATE_PAUSE_COUNT;
2828 } 2828 }
2829 [_add](data) { 2829 [_add](data) {
2830 dart.assert(!dart.notNull(this[_isClosed])); 2830 dart.assert(!dart.notNull(this[_isClosed]));
2831 if (this[_isCanceled]) 2831 if (this[_isCanceled])
2832 return; 2832 return;
2833 if (this[_canFire]) { 2833 if (this[_canFire]) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
2878 } 2878 }
2879 } 2879 }
2880 } 2880 }
2881 [_sendData](data) { 2881 [_sendData](data) {
2882 dart.assert(!dart.notNull(this[_isCanceled])); 2882 dart.assert(!dart.notNull(this[_isCanceled]));
2883 dart.assert(!dart.notNull(this[_isPaused])); 2883 dart.assert(!dart.notNull(this[_isPaused]));
2884 dart.assert(!dart.notNull(this[_inCallback])); 2884 dart.assert(!dart.notNull(this[_inCallback]));
2885 let wasInputPaused = this[_isInputPaused]; 2885 let wasInputPaused = this[_isInputPaused];
2886 this[_state] = _STATE_IN_CALLBACK; 2886 this[_state] = _STATE_IN_CALLBACK;
2887 this[_zone].runUnaryGuarded(dart.as(this[_onData], dart.throw_("Unimplem ented type (dynamic) → dynamic")), data); 2887 this[_zone].runUnaryGuarded(dart.as(this[_onData], dart.throw_("Unimplem ented type (dynamic) → dynamic")), data);
2888 this[_state] = ~_STATE_IN_CALLBACK; 2888 this[_state] = ~dart.notNull(_STATE_IN_CALLBACK);
2889 this[_checkState](wasInputPaused); 2889 this[_checkState](wasInputPaused);
2890 } 2890 }
2891 [_sendError](error, stackTrace) { 2891 [_sendError](error, stackTrace) {
2892 dart.assert(!dart.notNull(this[_isCanceled])); 2892 dart.assert(!dart.notNull(this[_isCanceled]));
2893 dart.assert(!dart.notNull(this[_isPaused])); 2893 dart.assert(!dart.notNull(this[_isPaused]));
2894 dart.assert(!dart.notNull(this[_inCallback])); 2894 dart.assert(!dart.notNull(this[_inCallback]));
2895 let wasInputPaused = this[_isInputPaused]; 2895 let wasInputPaused = this[_isInputPaused];
2896 // Function sendError: () → void 2896 // Function sendError: () → void
2897 function sendError() { 2897 function sendError() {
2898 if (dart.notNull(this[_isCanceled]) && dart.notNull(!dart.notNull(this [_waitsForCancel]))) 2898 if (dart.notNull(this[_isCanceled]) && !dart.notNull(this[_waitsForCan cel]))
2899 return; 2899 return;
2900 this[_state] = _STATE_IN_CALLBACK; 2900 this[_state] = _STATE_IN_CALLBACK;
2901 if (dart.is(this[_onError], ZoneBinaryCallback)) { 2901 if (dart.is(this[_onError], ZoneBinaryCallback)) {
2902 this[_zone].runBinaryGuarded(dart.as(this[_onError], dart.throw_("Un implemented type (dynamic, dynamic) → dynamic")), error, stackTrace); 2902 this[_zone].runBinaryGuarded(dart.as(this[_onError], dart.throw_("Un implemented type (dynamic, dynamic) → dynamic")), error, stackTrace);
2903 } else { 2903 } else {
2904 this[_zone].runUnaryGuarded(dart.as(this[_onError], dart.throw_("Uni mplemented type (dynamic) → dynamic")), error); 2904 this[_zone].runUnaryGuarded(dart.as(this[_onError], dart.throw_("Uni mplemented type (dynamic) → dynamic")), error);
2905 } 2905 }
2906 this[_state] = ~_STATE_IN_CALLBACK; 2906 this[_state] = ~dart.notNull(_STATE_IN_CALLBACK);
2907 } 2907 }
2908 if (this[_cancelOnError]) { 2908 if (this[_cancelOnError]) {
2909 this[_state] = _STATE_WAIT_FOR_CANCEL; 2909 this[_state] = _STATE_WAIT_FOR_CANCEL;
2910 this[_cancel](); 2910 this[_cancel]();
2911 if (dart.is(this[_cancelFuture], Future)) { 2911 if (dart.is(this[_cancelFuture], Future)) {
2912 this[_cancelFuture].whenComplete(sendError); 2912 this[_cancelFuture].whenComplete(sendError);
2913 } else { 2913 } else {
2914 sendError(); 2914 sendError();
2915 } 2915 }
2916 } else { 2916 } else {
2917 sendError(); 2917 sendError();
2918 this[_checkState](wasInputPaused); 2918 this[_checkState](wasInputPaused);
2919 } 2919 }
2920 } 2920 }
2921 [_sendDone]() { 2921 [_sendDone]() {
2922 dart.assert(!dart.notNull(this[_isCanceled])); 2922 dart.assert(!dart.notNull(this[_isCanceled]));
2923 dart.assert(!dart.notNull(this[_isPaused])); 2923 dart.assert(!dart.notNull(this[_isPaused]));
2924 dart.assert(!dart.notNull(this[_inCallback])); 2924 dart.assert(!dart.notNull(this[_inCallback]));
2925 // Function sendDone: () → void 2925 // Function sendDone: () → void
2926 function sendDone() { 2926 function sendDone() {
2927 if (!dart.notNull(this[_waitsForCancel])) 2927 if (!dart.notNull(this[_waitsForCancel]))
2928 return; 2928 return;
2929 this[_state] = _STATE_CANCELED | _STATE_CLOSED | _STATE_IN_CALLBACK; 2929 this[_state] = dart.notNull(_STATE_CANCELED) | dart.notNull(_STATE_CLO SED) | dart.notNull(_STATE_IN_CALLBACK);
2930 this[_zone].runGuarded(this[_onDone]); 2930 this[_zone].runGuarded(this[_onDone]);
2931 this[_state] = ~_STATE_IN_CALLBACK; 2931 this[_state] = ~dart.notNull(_STATE_IN_CALLBACK);
2932 } 2932 }
2933 this[_cancel](); 2933 this[_cancel]();
2934 this[_state] = _STATE_WAIT_FOR_CANCEL; 2934 this[_state] = _STATE_WAIT_FOR_CANCEL;
2935 if (dart.is(this[_cancelFuture], Future)) { 2935 if (dart.is(this[_cancelFuture], Future)) {
2936 this[_cancelFuture].whenComplete(sendDone); 2936 this[_cancelFuture].whenComplete(sendDone);
2937 } else { 2937 } else {
2938 sendDone(); 2938 sendDone();
2939 } 2939 }
2940 } 2940 }
2941 [_guardCallback](callback) { 2941 [_guardCallback](callback) {
2942 dart.assert(!dart.notNull(this[_inCallback])); 2942 dart.assert(!dart.notNull(this[_inCallback]));
2943 let wasInputPaused = this[_isInputPaused]; 2943 let wasInputPaused = this[_isInputPaused];
2944 this[_state] = _STATE_IN_CALLBACK; 2944 this[_state] = _STATE_IN_CALLBACK;
2945 dart.dinvokef(callback); 2945 dart.dinvokef(callback);
2946 this[_state] = ~_STATE_IN_CALLBACK; 2946 this[_state] = ~dart.notNull(_STATE_IN_CALLBACK);
2947 this[_checkState](wasInputPaused); 2947 this[_checkState](wasInputPaused);
2948 } 2948 }
2949 [_checkState](wasInputPaused) { 2949 [_checkState](wasInputPaused) {
2950 dart.assert(!dart.notNull(this[_inCallback])); 2950 dart.assert(!dart.notNull(this[_inCallback]));
2951 if (dart.notNull(this[_hasPending]) && dart.notNull(this[_pending].isEmp ty)) { 2951 if (dart.notNull(this[_hasPending]) && dart.notNull(this[_pending].isEmp ty)) {
2952 this[_state] = ~_STATE_HAS_PENDING; 2952 this[_state] = ~dart.notNull(_STATE_HAS_PENDING);
2953 if (dart.notNull(this[_isInputPaused]) && dart.notNull(this[_mayResume Input])) { 2953 if (dart.notNull(this[_isInputPaused]) && dart.notNull(this[_mayResume Input])) {
2954 this[_state] = ~_STATE_INPUT_PAUSED; 2954 this[_state] = ~dart.notNull(_STATE_INPUT_PAUSED);
2955 } 2955 }
2956 } 2956 }
2957 while (true) { 2957 while (true) {
2958 if (this[_isCanceled]) { 2958 if (this[_isCanceled]) {
2959 this[_pending] = null; 2959 this[_pending] = null;
2960 return; 2960 return;
2961 } 2961 }
2962 let isInputPaused = this[_isInputPaused]; 2962 let isInputPaused = this[_isInputPaused];
2963 if (wasInputPaused === isInputPaused) 2963 if (wasInputPaused === isInputPaused)
2964 break; 2964 break;
2965 this[_state] = _STATE_IN_CALLBACK; 2965 this[_state] = _STATE_IN_CALLBACK;
2966 if (isInputPaused) { 2966 if (isInputPaused) {
2967 this[_onPause](); 2967 this[_onPause]();
2968 } else { 2968 } else {
2969 this[_onResume](); 2969 this[_onResume]();
2970 } 2970 }
2971 this[_state] = ~_STATE_IN_CALLBACK; 2971 this[_state] = ~dart.notNull(_STATE_IN_CALLBACK);
2972 wasInputPaused = isInputPaused; 2972 wasInputPaused = isInputPaused;
2973 } 2973 }
2974 if (dart.notNull(this[_hasPending]) && dart.notNull(!dart.notNull(this[_ isPaused]))) { 2974 if (dart.notNull(this[_hasPending]) && !dart.notNull(this[_isPaused])) {
2975 this[_pending].schedule(this); 2975 this[_pending].schedule(this);
2976 } 2976 }
2977 } 2977 }
2978 } 2978 }
2979 _BufferingStreamSubscription._STATE_CANCEL_ON_ERROR = 1; 2979 _BufferingStreamSubscription._STATE_CANCEL_ON_ERROR = 1;
2980 _BufferingStreamSubscription._STATE_CLOSED = 2; 2980 _BufferingStreamSubscription._STATE_CLOSED = 2;
2981 _BufferingStreamSubscription._STATE_INPUT_PAUSED = 4; 2981 _BufferingStreamSubscription._STATE_INPUT_PAUSED = 4;
2982 _BufferingStreamSubscription._STATE_CANCELED = 8; 2982 _BufferingStreamSubscription._STATE_CANCELED = 8;
2983 _BufferingStreamSubscription._STATE_WAIT_FOR_CANCEL = 16; 2983 _BufferingStreamSubscription._STATE_WAIT_FOR_CANCEL = 16;
2984 _BufferingStreamSubscription._STATE_IN_CALLBACK = 32; 2984 _BufferingStreamSubscription._STATE_IN_CALLBACK = 32;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
3123 } 3123 }
3124 let _eventScheduled = Symbol('_eventScheduled'); 3124 let _eventScheduled = Symbol('_eventScheduled');
3125 class _PendingEvents extends dart.Object { 3125 class _PendingEvents extends dart.Object {
3126 _PendingEvents() { 3126 _PendingEvents() {
3127 this[_state] = _STATE_UNSCHEDULED; 3127 this[_state] = _STATE_UNSCHEDULED;
3128 } 3128 }
3129 get isScheduled() { 3129 get isScheduled() {
3130 return this[_state] === _STATE_SCHEDULED; 3130 return this[_state] === _STATE_SCHEDULED;
3131 } 3131 }
3132 get [_eventScheduled]() { 3132 get [_eventScheduled]() {
3133 return this[_state] >= _STATE_SCHEDULED; 3133 return dart.notNull(this[_state]) >= dart.notNull(_STATE_SCHEDULED);
3134 } 3134 }
3135 schedule(dispatch) { 3135 schedule(dispatch) {
3136 if (this.isScheduled) 3136 if (this.isScheduled)
3137 return; 3137 return;
3138 dart.assert(!dart.notNull(this.isEmpty)); 3138 dart.assert(!dart.notNull(this.isEmpty));
3139 if (this[_eventScheduled]) { 3139 if (this[_eventScheduled]) {
3140 dart.assert(this[_state] === _STATE_CANCELED); 3140 dart.assert(this[_state] === _STATE_CANCELED);
3141 this[_state] = _STATE_SCHEDULED; 3141 this[_state] = _STATE_SCHEDULED;
3142 return; 3142 return;
3143 } 3143 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
3214 let _isScheduled = Symbol('_isScheduled'); 3214 let _isScheduled = Symbol('_isScheduled');
3215 let _DoneStreamSubscription$ = dart.generic(function(T) { 3215 let _DoneStreamSubscription$ = dart.generic(function(T) {
3216 class _DoneStreamSubscription extends dart.Object { 3216 class _DoneStreamSubscription extends dart.Object {
3217 _DoneStreamSubscription($_onDone) { 3217 _DoneStreamSubscription($_onDone) {
3218 this[_onDone] = $_onDone; 3218 this[_onDone] = $_onDone;
3219 this[_zone] = Zone.current; 3219 this[_zone] = Zone.current;
3220 this[_state] = 0; 3220 this[_state] = 0;
3221 this[_schedule](); 3221 this[_schedule]();
3222 } 3222 }
3223 get [_isSent]() { 3223 get [_isSent]() {
3224 return (this[_state] & _DONE_SENT) !== 0; 3224 return (dart.notNull(this[_state]) & dart.notNull(_DONE_SENT)) !== 0;
3225 } 3225 }
3226 get [_isScheduled]() { 3226 get [_isScheduled]() {
3227 return (this[_state] & _SCHEDULED) !== 0; 3227 return (dart.notNull(this[_state]) & dart.notNull(_SCHEDULED)) !== 0;
3228 } 3228 }
3229 get isPaused() { 3229 get isPaused() {
3230 return this[_state] >= _PAUSED; 3230 return dart.notNull(this[_state]) >= dart.notNull(_PAUSED);
3231 } 3231 }
3232 [_schedule]() { 3232 [_schedule]() {
3233 if (this[_isScheduled]) 3233 if (this[_isScheduled])
3234 return; 3234 return;
3235 this[_zone].scheduleMicrotask(this[_sendDone]); 3235 this[_zone].scheduleMicrotask(this[_sendDone]);
3236 this[_state] = _SCHEDULED; 3236 this[_state] = _SCHEDULED;
3237 } 3237 }
3238 onData(handleData) {} 3238 onData(handleData) {}
3239 onError(handleError) {} 3239 onError(handleError) {}
3240 onDone(handleDone) { 3240 onDone(handleDone) {
3241 this[_onDone] = handleDone; 3241 this[_onDone] = handleDone;
3242 } 3242 }
3243 pause(resumeSignal) { 3243 pause(resumeSignal) {
3244 if (resumeSignal === void 0) 3244 if (resumeSignal === void 0)
3245 resumeSignal = null; 3245 resumeSignal = null;
3246 this[_state] = _PAUSED; 3246 this[_state] = _PAUSED;
3247 if (resumeSignal !== null) 3247 if (resumeSignal !== null)
3248 resumeSignal.whenComplete(this.resume); 3248 resumeSignal.whenComplete(this.resume);
3249 } 3249 }
3250 resume() { 3250 resume() {
3251 if (this.isPaused) { 3251 if (this.isPaused) {
3252 this[_state] = _PAUSED; 3252 this[_state] = _PAUSED;
3253 if (dart.notNull(!dart.notNull(this.isPaused)) && dart.notNull(!dart.n otNull(this[_isSent]))) { 3253 if (!dart.notNull(this.isPaused) && !dart.notNull(this[_isSent])) {
3254 this[_schedule](); 3254 this[_schedule]();
3255 } 3255 }
3256 } 3256 }
3257 } 3257 }
3258 cancel() { 3258 cancel() {
3259 return null; 3259 return null;
3260 } 3260 }
3261 asFuture(futureValue) { 3261 asFuture(futureValue) {
3262 if (futureValue === void 0) 3262 if (futureValue === void 0)
3263 futureValue = null; 3263 futureValue = null;
3264 let result = new _Future(); 3264 let result = new _Future();
3265 this[_onDone] = (() => { 3265 this[_onDone] = (() => {
3266 result._completeWithValue(null); 3266 result._completeWithValue(null);
3267 }).bind(this); 3267 }).bind(this);
3268 return result; 3268 return result;
3269 } 3269 }
3270 [_sendDone]() { 3270 [_sendDone]() {
3271 this[_state] = ~_SCHEDULED; 3271 this[_state] = ~dart.notNull(_SCHEDULED);
3272 if (this.isPaused) 3272 if (this.isPaused)
3273 return; 3273 return;
3274 this[_state] = _DONE_SENT; 3274 this[_state] = _DONE_SENT;
3275 if (this[_onDone] !== null) 3275 if (this[_onDone] !== null)
3276 this[_zone].runGuarded(this[_onDone]); 3276 this[_zone].runGuarded(this[_onDone]);
3277 } 3277 }
3278 } 3278 }
3279 _DoneStreamSubscription._DONE_SENT = 1; 3279 _DoneStreamSubscription._DONE_SENT = 1;
3280 _DoneStreamSubscription._SCHEDULED = 2; 3280 _DoneStreamSubscription._SCHEDULED = 2;
3281 _DoneStreamSubscription._PAUSED = 4; 3281 _DoneStreamSubscription._PAUSED = 4;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
3399 return _BroadcastSubscriptionWrapper; 3399 return _BroadcastSubscriptionWrapper;
3400 }); 3400 });
3401 let _BroadcastSubscriptionWrapper = _BroadcastSubscriptionWrapper$(dynamic); 3401 let _BroadcastSubscriptionWrapper = _BroadcastSubscriptionWrapper$(dynamic);
3402 let _current = Symbol('_current'); 3402 let _current = Symbol('_current');
3403 let _futureOrPrefetch = Symbol('_futureOrPrefetch'); 3403 let _futureOrPrefetch = Symbol('_futureOrPrefetch');
3404 let _clear = Symbol('_clear'); 3404 let _clear = Symbol('_clear');
3405 let _StreamIteratorImpl$ = dart.generic(function(T) { 3405 let _StreamIteratorImpl$ = dart.generic(function(T) {
3406 class _StreamIteratorImpl extends dart.Object { 3406 class _StreamIteratorImpl extends dart.Object {
3407 _StreamIteratorImpl(stream) { 3407 _StreamIteratorImpl(stream) {
3408 this[_subscription] = null; 3408 this[_subscription] = null;
3409 this[_current] = dart.as(null, T); 3409 this[_current] = null;
3410 this[_futureOrPrefetch] = null; 3410 this[_futureOrPrefetch] = null;
3411 this[_state] = _STATE_FOUND; 3411 this[_state] = _STATE_FOUND;
3412 this[_subscription] = stream.listen(this[_onData], {onError: this[_onErr or], onDone: this[_onDone], cancelOnError: true}); 3412 this[_subscription] = stream.listen(this[_onData], {onError: this[_onErr or], onDone: this[_onDone], cancelOnError: true});
3413 } 3413 }
3414 get current() { 3414 get current() {
3415 return this[_current]; 3415 return this[_current];
3416 } 3416 }
3417 moveNext() { 3417 moveNext() {
3418 if (this[_state] === _STATE_DONE) { 3418 if (this[_state] === _STATE_DONE) {
3419 return new _Future.immediate(false); 3419 return new _Future.immediate(false);
3420 } 3420 }
3421 if (this[_state] === _STATE_MOVING) { 3421 if (this[_state] === _STATE_MOVING) {
3422 throw new core.StateError("Already waiting for next."); 3422 throw new core.StateError("Already waiting for next.");
3423 } 3423 }
3424 if (this[_state] === _STATE_FOUND) { 3424 if (this[_state] === _STATE_FOUND) {
3425 this[_state] = _STATE_MOVING; 3425 this[_state] = _STATE_MOVING;
3426 this[_current] = dart.as(null, T); 3426 this[_current] = null;
3427 this[_futureOrPrefetch] = new _Future(); 3427 this[_futureOrPrefetch] = new _Future();
3428 return dart.as(this[_futureOrPrefetch], Future$(core.bool)); 3428 return dart.as(this[_futureOrPrefetch], Future$(core.bool));
3429 } else { 3429 } else {
3430 dart.assert(this[_state] >= _STATE_EXTRA_DATA); 3430 dart.assert(dart.notNull(this[_state]) >= dart.notNull(_STATE_EXTRA_DA TA));
3431 switch (this[_state]) { 3431 switch (this[_state]) {
3432 case _STATE_EXTRA_DATA: 3432 case _STATE_EXTRA_DATA:
3433 this[_state] = _STATE_FOUND; 3433 this[_state] = _STATE_FOUND;
3434 this[_current] = dart.as(this[_futureOrPrefetch], T); 3434 this[_current] = dart.as(this[_futureOrPrefetch], T);
3435 this[_futureOrPrefetch] = null; 3435 this[_futureOrPrefetch] = null;
3436 this[_subscription].resume(); 3436 this[_subscription].resume();
3437 return new _Future.immediate(true); 3437 return new _Future.immediate(true);
3438 case _STATE_EXTRA_ERROR: 3438 case _STATE_EXTRA_ERROR:
3439 let prefetch = dart.as(this[_futureOrPrefetch], AsyncError); 3439 let prefetch = dart.as(this[_futureOrPrefetch], AsyncError);
3440 this[_clear](); 3440 this[_clear]();
3441 return new _Future.immediateError(prefetch.error, prefetch.stackTr ace); 3441 return new _Future.immediateError(prefetch.error, prefetch.stackTr ace);
3442 case _STATE_EXTRA_DONE: 3442 case _STATE_EXTRA_DONE:
3443 this[_clear](); 3443 this[_clear]();
3444 return new _Future.immediate(false); 3444 return new _Future.immediate(false);
3445 } 3445 }
3446 } 3446 }
3447 } 3447 }
3448 [_clear]() { 3448 [_clear]() {
3449 this[_subscription] = null; 3449 this[_subscription] = null;
3450 this[_futureOrPrefetch] = null; 3450 this[_futureOrPrefetch] = null;
3451 this[_current] = dart.as(null, T); 3451 this[_current] = null;
3452 this[_state] = _STATE_DONE; 3452 this[_state] = _STATE_DONE;
3453 } 3453 }
3454 cancel() { 3454 cancel() {
3455 let subscription = this[_subscription]; 3455 let subscription = this[_subscription];
3456 if (this[_state] === _STATE_MOVING) { 3456 if (this[_state] === _STATE_MOVING) {
3457 let hasNext = dart.as(this[_futureOrPrefetch], _Future$(core.bool)); 3457 let hasNext = dart.as(this[_futureOrPrefetch], _Future$(core.bool));
3458 this[_clear](); 3458 this[_clear]();
3459 hasNext._complete(false); 3459 hasNext._complete(false);
3460 } else { 3460 } else {
3461 this[_clear](); 3461 this[_clear]();
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
3766 let _remaining = Symbol('_remaining'); 3766 let _remaining = Symbol('_remaining');
3767 let _TakeStream$ = dart.generic(function(T) { 3767 let _TakeStream$ = dart.generic(function(T) {
3768 class _TakeStream extends _ForwardingStream$(T, T) { 3768 class _TakeStream extends _ForwardingStream$(T, T) {
3769 _TakeStream(source, count) { 3769 _TakeStream(source, count) {
3770 this[_remaining] = count; 3770 this[_remaining] = count;
3771 super._ForwardingStream(source); 3771 super._ForwardingStream(source);
3772 if (!(typeof count == number)) 3772 if (!(typeof count == number))
3773 throw new core.ArgumentError(count); 3773 throw new core.ArgumentError(count);
3774 } 3774 }
3775 [_handleData](inputEvent, sink) { 3775 [_handleData](inputEvent, sink) {
3776 if (this[_remaining] > 0) { 3776 if (dart.notNull(this[_remaining]) > 0) {
3777 sink._add(inputEvent); 3777 sink._add(inputEvent);
3778 this[_remaining] = 1; 3778 this[_remaining] = 1;
3779 if (this[_remaining] === 0) { 3779 if (this[_remaining] === 0) {
3780 sink._close(); 3780 sink._close();
3781 } 3781 }
3782 } 3782 }
3783 } 3783 }
3784 } 3784 }
3785 return _TakeStream; 3785 return _TakeStream;
3786 }); 3786 });
(...skipping 23 matching lines...) Expand all
3810 } 3810 }
3811 } 3811 }
3812 return _TakeWhileStream; 3812 return _TakeWhileStream;
3813 }); 3813 });
3814 let _TakeWhileStream = _TakeWhileStream$(dynamic); 3814 let _TakeWhileStream = _TakeWhileStream$(dynamic);
3815 let _SkipStream$ = dart.generic(function(T) { 3815 let _SkipStream$ = dart.generic(function(T) {
3816 class _SkipStream extends _ForwardingStream$(T, T) { 3816 class _SkipStream extends _ForwardingStream$(T, T) {
3817 _SkipStream(source, count) { 3817 _SkipStream(source, count) {
3818 this[_remaining] = count; 3818 this[_remaining] = count;
3819 super._ForwardingStream(source); 3819 super._ForwardingStream(source);
3820 if (dart.notNull(!(typeof count == number)) || dart.notNull(count < 0)) 3820 if (dart.notNull(!(typeof count == number)) || dart.notNull(count) < 0)
3821 throw new core.ArgumentError(count); 3821 throw new core.ArgumentError(count);
3822 } 3822 }
3823 [_handleData](inputEvent, sink) { 3823 [_handleData](inputEvent, sink) {
3824 if (this[_remaining] > 0) { 3824 if (dart.notNull(this[_remaining]) > 0) {
3825 this[_remaining]--; 3825 dart.notNull(this[_remaining])--;
3826 return; 3826 return;
3827 } 3827 }
3828 sink._add(inputEvent); 3828 sink._add(inputEvent);
3829 } 3829 }
3830 } 3830 }
3831 return _SkipStream; 3831 return _SkipStream;
3832 }); 3832 });
3833 let _SkipStream = _SkipStream$(dynamic); 3833 let _SkipStream = _SkipStream$(dynamic);
3834 let _hasFailed = Symbol('_hasFailed'); 3834 let _hasFailed = Symbol('_hasFailed');
3835 let _SkipWhileStream$ = dart.generic(function(T) { 3835 let _SkipWhileStream$ = dart.generic(function(T) {
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
4153 if (dart.equals(Zone.current, Zone.ROOT)) { 4153 if (dart.equals(Zone.current, Zone.ROOT)) {
4154 return Zone.current.createPeriodicTimer(duration, callback); 4154 return Zone.current.createPeriodicTimer(duration, callback);
4155 } 4155 }
4156 return Zone.current.createPeriodicTimer(duration, Zone.current.bindUnaryCa llback(dart.as(callback, dart.throw_("Unimplemented type (dynamic) → dynamic")), {runGuarded: true})); 4156 return Zone.current.createPeriodicTimer(duration, Zone.current.bindUnaryCa llback(dart.as(callback, dart.throw_("Unimplemented type (dynamic) → dynamic")), {runGuarded: true}));
4157 } 4157 }
4158 static run(callback) { 4158 static run(callback) {
4159 new Timer(core.Duration.ZERO, callback); 4159 new Timer(core.Duration.ZERO, callback);
4160 } 4160 }
4161 static [_createTimer](duration, callback) { 4161 static [_createTimer](duration, callback) {
4162 let milliseconds = duration.inMilliseconds; 4162 let milliseconds = duration.inMilliseconds;
4163 if (milliseconds < 0) 4163 if (dart.notNull(milliseconds) < 0)
4164 milliseconds = 0; 4164 milliseconds = 0;
4165 return new _isolate_helper.TimerImpl(milliseconds, callback); 4165 return new _isolate_helper.TimerImpl(milliseconds, callback);
4166 } 4166 }
4167 static [_createPeriodicTimer](duration, callback) { 4167 static [_createPeriodicTimer](duration, callback) {
4168 let milliseconds = duration.inMilliseconds; 4168 let milliseconds = duration.inMilliseconds;
4169 if (milliseconds < 0) 4169 if (dart.notNull(milliseconds) < 0)
4170 milliseconds = 0; 4170 milliseconds = 0;
4171 return new _isolate_helper.TimerImpl.periodic(milliseconds, callback); 4171 return new _isolate_helper.TimerImpl.periodic(milliseconds, callback);
4172 } 4172 }
4173 } 4173 }
4174 dart.defineNamedConstructor(Timer, 'periodic'); 4174 dart.defineNamedConstructor(Timer, 'periodic');
4175 class AsyncError extends dart.Object { 4175 class AsyncError extends dart.Object {
4176 AsyncError(error, stackTrace) { 4176 AsyncError(error, stackTrace) {
4177 this.error = error; 4177 this.error = error;
4178 this.stackTrace = stackTrace; 4178 this.stackTrace = stackTrace;
4179 } 4179 }
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
4943 exports.StreamIterator$ = StreamIterator$; 4943 exports.StreamIterator$ = StreamIterator$;
4944 exports.StreamController = StreamController; 4944 exports.StreamController = StreamController;
4945 exports.StreamController$ = StreamController$; 4945 exports.StreamController$ = StreamController$;
4946 exports.Timer = Timer; 4946 exports.Timer = Timer;
4947 exports.AsyncError = AsyncError; 4947 exports.AsyncError = AsyncError;
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

Powered by Google App Engine
This is Rietveld 408576698