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

Side by Side Diff: test/dart_codegen/expect/async/future.dart

Issue 1021273004: Allow arity checks on dynamic function types (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Address jacobr's comments 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 part of dart.async; 1 part of dart.async;
2 abstract class Future<T> {static final _Future _nullFuture = ((__x10) => DEVC$R T.cast(__x10, DEVC$RT.type((Future<dynamic> _) { 2 abstract class Future<T> {static final _Future _nullFuture = ((__x10) => DEVC$R T.cast(__x10, DEVC$RT.type((Future<dynamic> _) {
3 } 3 }
4 ), DEVC$RT.type((_Future<dynamic> _) { 4 ), DEVC$RT.type((_Future<dynamic> _) {
5 } 5 }
6 ), "CastExact", """line 98, column 38 of dart:async/future.dart: """, __x10 is _ Future<dynamic>, true))(new Future.value(null)); 6 ), "CastExact", """line 98, column 38 of dart:async/future.dart: """, __x10 is _ Future<dynamic>, true))(new Future.value(null));
7 factory Future(computation()) { 7 factory Future(computation()) {
8 _Future result = new _Future<T>(); 8 _Future result = new _Future<T>();
9 Timer.run(() { 9 Timer.run(() {
10 try { 10 try {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (!iterator.moveNext()) return false; 152 if (!iterator.moveNext()) return false;
153 return new Future.sync(() => f(iterator.current)).then((_) => true); 153 return new Future.sync(() => f(iterator.current)).then((_) => true);
154 } 154 }
155 ); 155 );
156 } 156 }
157 static Future doWhile(f()) { 157 static Future doWhile(f()) {
158 _Future doneSignal = new _Future(); 158 _Future doneSignal = new _Future();
159 var nextIteration; 159 var nextIteration;
160 nextIteration = Zone.current.bindUnaryCallback((bool keepGoing) { 160 nextIteration = Zone.current.bindUnaryCallback((bool keepGoing) {
161 if (keepGoing) { 161 if (keepGoing) {
162 new Future.sync(f).then(DEVC$RT.cast(nextIteration, dynamic, __t12, "CastG eneral", """line 361, column 33 of dart:async/future.dart: """, nextIteration is __t12, false), onError: doneSignal._completeError); 162 new Future.sync(f).then(DEVC$RT.cast(nextIteration, dynamic, __t12, "CastG eneral", """line 361, column 33 of dart:async/future.dart: """, nextIteration is __t12, true), onError: doneSignal._completeError);
163 } 163 }
164 else { 164 else {
165 doneSignal._complete(null); 165 doneSignal._complete(null);
166 } 166 }
167 } 167 }
168 , runGuarded: true); 168 , runGuarded: true);
169 nextIteration(true); 169 nextIteration(true);
170 return doneSignal; 170 return doneSignal;
171 } 171 }
172 Future then(onValue(T value), { 172 Future then(onValue(T value), {
(...skipping 28 matching lines...) Expand all
201 void _completeWithErrorCallback(_Future result, error, stackTrace) { 201 void _completeWithErrorCallback(_Future result, error, stackTrace) {
202 AsyncError replacement = Zone.current.errorCallback(error, DEVC$RT.cast(stackTra ce, dynamic, StackTrace, "CastGeneral", """line 719, column 62 of dart:async/fut ure.dart: """, stackTrace is StackTrace, true)); 202 AsyncError replacement = Zone.current.errorCallback(error, DEVC$RT.cast(stackTra ce, dynamic, StackTrace, "CastGeneral", """line 719, column 62 of dart:async/fut ure.dart: """, stackTrace is StackTrace, true));
203 if (replacement != null) { 203 if (replacement != null) {
204 error = _nonNullError(replacement.error); 204 error = _nonNullError(replacement.error);
205 stackTrace = replacement.stackTrace; 205 stackTrace = replacement.stackTrace;
206 } 206 }
207 result._completeError(error, DEVC$RT.cast(stackTrace, dynamic, StackTrace, "Cas tGeneral", """line 724, column 32 of dart:async/future.dart: """, stackTrace is StackTrace, true)); 207 result._completeError(error, DEVC$RT.cast(stackTrace, dynamic, StackTrace, "Cas tGeneral", """line 724, column 32 of dart:async/future.dart: """, stackTrace is StackTrace, true));
208 } 208 }
209 Object _nonNullError(Object error) => (error != null) ? error : new NullThrownE rror(); 209 Object _nonNullError(Object error) => (error != null) ? error : new NullThrownE rror();
210 typedef dynamic __t12(dynamic __u13); 210 typedef dynamic __t12(dynamic __u13);
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/async/async_error.dart ('k') | test/dart_codegen/expect/async/future_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698