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

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

Issue 977153002: Fix increment on nullable (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Remove assignments 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 | « test/codegen/expect/dart/_native_typed_data.js ('k') | test/codegen/expect/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 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 dart.notNull(this[_pauseCount])++; 496 this[_pauseCount] = dart.notNull(this[_pauseCount]) + 1;
497 } 497 }
498 resume() { 498 resume() {
499 this[_resume](null); 499 this[_resume](null);
500 } 500 }
501 [_resume](_) { 501 [_resume](_) {
502 if (dart.notNull(this[_pauseCount]) > 0) 502 if (dart.notNull(this[_pauseCount]) > 0)
503 dart.notNull(this[_pauseCount])--; 503 this[_pauseCount] = dart.notNull(this[_pauseCount]) - 1;
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 dart.notNull(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;
(...skipping 97 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 dart.notNull(remaining)--; 621 remaining = dart.notNull(remaining) - 1;
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 (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 (remaining === 0 && !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 = dart.notNull(remaining)++; 644 let pos = (($tmp) => remaining = dart.notNull($tmp) + 1, $tmp)(remaini ng);
645 future.then(dart.as(((value) => { 645 future.then(dart.as(((value) => {
646 dart.notNull(remaining)--; 646 remaining = dart.notNull(remaining) - 1;
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 });
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 computation = null; 1488 computation = null;
1489 if (computation === null) 1489 if (computation === null)
1490 computation = (i) => null; 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(dart.notNull(computationCount)++); 1498 let data = computation((($tmp) => computationCount = dart.notNull($tmp ) + 1, $tmp)(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 dart.notNull(count)++; 1768 count = dart.notNull(count) + 1;
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 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (dart.notNull(this[_remaining]) > 0) { 3824 if (dart.notNull(this[_remaining]) > 0) {
3825 dart.notNull(this[_remaining])--; 3825 this[_remaining] = dart.notNull(this[_remaining]) - 1;
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 1107 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
« no previous file with comments | « test/codegen/expect/dart/_native_typed_data.js ('k') | test/codegen/expect/dart/collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698