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

Side by Side Diff: tests/compiler/dart2js/async_await_js_transform_test.dart

Issue 996103002: Fix handling of lazy and and or in async functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Review 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 | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | tests/language/async_and_or_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "package:compiler/src/js/js.dart"; 6 import "package:compiler/src/js/js.dart";
7 import "package:compiler/src/js/rewrite_async.dart"; 7 import "package:compiler/src/js/rewrite_async.dart";
8 8
9 import "backend_dart/dart_printer_test.dart" show PrintDiagnosticListener; 9 import "backend_dart/dart_printer_test.dart" show PrintDiagnosticListener;
10 10
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 function __body(__errorCode, __result) { 255 function __body(__errorCode, __result) {
256 if (__errorCode === 1) { 256 if (__errorCode === 1) {
257 __currentError = __result; 257 __currentError = __result;
258 __goto = __handler; 258 __goto = __handler;
259 } 259 }
260 while (true) 260 while (true)
261 switch (__goto) { 261 switch (__goto) {
262 case 0: 262 case 0:
263 // Function start 263 // Function start
264 __temp1 = foo1(); 264 __temp1 = foo1();
265 if (__temp1) { 265 if (__temp1)
266 __result = __temp1;
267 else {
266 // goto then 268 // goto then
267 __goto = 2; 269 __goto = 2;
268 break; 270 break;
269 } else 271 }
270 __result = __temp1;
271 // goto join 272 // goto join
272 __goto = 3; 273 __goto = 3;
273 break; 274 break;
274 case 2: 275 case 2:
275 // then 276 // then
276 __goto = 4; 277 __goto = 4;
277 return thenHelper(foo2(), __body, __completer); 278 return thenHelper(foo2(), __body, __completer);
278 case 4: 279 case 4:
279 // returning from await. 280 // returning from await.
280 case 3: 281 case 3:
281 // join 282 // join
282 a = __result; 283 a = __result;
283 __goto = 5; 284 __goto = 5;
284 return thenHelper(foo1(), __body, __completer); 285 return thenHelper(foo1(), __body, __completer);
285 case 5: 286 case 5:
286 // returning from await. 287 // returning from await.
287 b = __result || foo2(); 288 b = __result || foo2();
288 __goto = 8; 289 __goto = 8;
289 return thenHelper(foo1(), __body, __completer); 290 return thenHelper(foo1(), __body, __completer);
290 case 8: 291 case 8:
291 // returning from await. 292 // returning from await.
292 __temp1 = __result; 293 __temp1 = __result;
293 if (__temp1) { 294 if (__temp1)
295 __result = __temp1;
296 else {
294 // goto then 297 // goto then
295 __goto = 6; 298 __goto = 6;
296 break; 299 break;
297 } else 300 }
298 __result = __temp1;
299 // goto join 301 // goto join
300 __goto = 7; 302 __goto = 7;
301 break; 303 break;
302 case 6: 304 case 6:
303 // then 305 // then
304 __temp1 = foo3; 306 __temp1 = foo3;
305 __goto = 9; 307 __goto = 9;
306 return thenHelper(foo2(), __body, __completer); 308 return thenHelper(foo2(), __body, __completer);
307 case 9: 309 case 9:
308 // returning from await. 310 // returning from await.
309 __result = __temp1(__result); 311 __result = __temp1(__result);
310 case 7: 312 case 7:
311 // join 313 // join
312 c = __result; 314 c = __result;
313 d = foo1() || foo2(); 315 d = foo1() || foo2();
314 __temp1 = foo1(); 316 __temp1 = foo1();
315 if (__temp1) 317 if (__temp1) {
316 __result = __temp1;
317 else {
318 // goto then 318 // goto then
319 __goto = 10; 319 __goto = 10;
320 break; 320 break;
321 } 321 } else
322 __result = __temp1;
322 // goto join 323 // goto join
323 __goto = 11; 324 __goto = 11;
324 break; 325 break;
325 case 10: 326 case 10:
326 // then 327 // then
327 __goto = 12; 328 __goto = 12;
328 return thenHelper(foo2(), __body, __completer); 329 return thenHelper(foo2(), __body, __completer);
329 case 12: 330 case 12:
330 // returning from await. 331 // returning from await.
331 case 11: 332 case 11:
332 // join 333 // join
333 e = __result; 334 e = __result;
334 __goto = 13; 335 __goto = 13;
335 return thenHelper(foo1(), __body, __completer); 336 return thenHelper(foo1(), __body, __completer);
336 case 13: 337 case 13:
337 // returning from await. 338 // returning from await.
338 f = __result && foo2(); 339 f = __result && foo2();
339 __goto = 16; 340 __goto = 16;
340 return thenHelper(foo1(), __body, __completer); 341 return thenHelper(foo1(), __body, __completer);
341 case 16: 342 case 16:
342 // returning from await. 343 // returning from await.
343 __temp1 = __result; 344 __temp1 = __result;
344 if (__temp1) 345 if (__temp1) {
345 __result = __temp1;
346 else {
347 // goto then 346 // goto then
348 __goto = 14; 347 __goto = 14;
349 break; 348 break;
350 } 349 } else
350 __result = __temp1;
351 // goto join 351 // goto join
352 __goto = 15; 352 __goto = 15;
353 break; 353 break;
354 case 14: 354 case 14:
355 // then 355 // then
356 __goto = 17; 356 __goto = 17;
357 return thenHelper(foo2(), __body, __completer); 357 return thenHelper(foo2(), __body, __completer);
358 case 17: 358 case 17:
359 // returning from await. 359 // returning from await.
360 case 15: 360 case 15:
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 // implicit return 1057 // implicit return
1058 return thenHelper(null, 0, __completer, null); 1058 return thenHelper(null, 0, __completer, null);
1059 case 1: 1059 case 1:
1060 // rethrow 1060 // rethrow
1061 return thenHelper(__currentError, 1, __completer); 1061 return thenHelper(__currentError, 1, __completer);
1062 } 1062 }
1063 } 1063 }
1064 return thenHelper(null, __body, __completer, null); 1064 return thenHelper(null, __body, __completer, null);
1065 }"""); 1065 }""");
1066 } 1066 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | tests/language/async_and_or_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698