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

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

Issue 949753004: Avoid printing braces for one-statement blocks in js-printer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: label: break label; => ; and update unittest 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/js_ast/lib/src/printer.dart ('k') | tests/compiler/dart2js/js_parser_statements_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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 __outer1: 94 __outer1:
95 switch (__goto) { 95 switch (__goto) {
96 case 0: 96 case 0:
97 // Function start 97 // Function start
98 __handler = 3; 98 __handler = 3;
99 case 7: 99 case 7:
100 // continue __outer 100 // continue __outer
101 case 8: 101 case 8:
102 // while condition 102 // while condition
103 __handler = 10; 103 __handler = 10;
104 inner: { 104 inner:
105 while (true) { 105 while (true) {
106 __next = [6]; 106 __next = [6];
107 // goto finally 107 // goto finally
108 __goto = 11; 108 __goto = 11;
109 break __outer1; 109 break __outer1;
110 break; 110 break;
111 } 111 }
112 }
113 while (true) { 112 while (true) {
114 __next = [1, 4]; 113 __next = [1, 4];
115 // goto finally 114 // goto finally
116 __goto = 11; 115 __goto = 11;
117 break __outer1; 116 break __outer1;
118 } 117 }
119 __goto = 13; 118 __goto = 13;
120 return thenHelper(foo(), __body, __completer); 119 return thenHelper(foo(), __body, __completer);
121 case 13: 120 case 13:
122 // returning from await. 121 // returning from await.
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 __goto = 9; 307 __goto = 9;
309 return thenHelper(foo2(), __body, __completer); 308 return thenHelper(foo2(), __body, __completer);
310 case 9: 309 case 9:
311 // returning from await. 310 // returning from await.
312 __result = __temp1(__result); 311 __result = __temp1(__result);
313 case 7: 312 case 7:
314 // join 313 // join
315 c = __result; 314 c = __result;
316 d = foo1() || foo2(); 315 d = foo1() || foo2();
317 __temp1 = foo1(); 316 __temp1 = foo1();
318 if (__temp1) { 317 if (__temp1)
319 __result = __temp1; 318 __result = __temp1;
320 } else { 319 else {
321 // goto then 320 // goto then
322 __goto = 10; 321 __goto = 10;
323 break; 322 break;
324 } 323 }
325 // goto join 324 // goto join
326 __goto = 11; 325 __goto = 11;
327 break; 326 break;
328 case 10: 327 case 10:
329 // then 328 // then
330 __goto = 12; 329 __goto = 12;
331 return thenHelper(foo2(), __body, __completer); 330 return thenHelper(foo2(), __body, __completer);
332 case 12: 331 case 12:
333 // returning from await. 332 // returning from await.
334 case 11: 333 case 11:
335 // join 334 // join
336 e = __result; 335 e = __result;
337 __goto = 13; 336 __goto = 13;
338 return thenHelper(foo1(), __body, __completer); 337 return thenHelper(foo1(), __body, __completer);
339 case 13: 338 case 13:
340 // returning from await. 339 // returning from await.
341 f = __result && foo2(); 340 f = __result && foo2();
342 __goto = 16; 341 __goto = 16;
343 return thenHelper(foo1(), __body, __completer); 342 return thenHelper(foo1(), __body, __completer);
344 case 16: 343 case 16:
345 // returning from await. 344 // returning from await.
346 __temp1 = __result; 345 __temp1 = __result;
347 if (__temp1) { 346 if (__temp1)
348 __result = __temp1; 347 __result = __temp1;
349 } else { 348 else {
350 // goto then 349 // goto then
351 __goto = 14; 350 __goto = 14;
352 break; 351 break;
353 } 352 }
354 // goto join 353 // goto join
355 __goto = 15; 354 __goto = 15;
356 break; 355 break;
357 case 14: 356 case 14:
358 // then 357 // then
359 __goto = 17; 358 __goto = 17;
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 return thenHelper(foobar(x), __body, __completer); 976 return thenHelper(foobar(x), __body, __completer);
978 case 17: 977 case 17:
979 // returning from await. 978 // returning from await.
980 __temp1(__result); 979 __temp1(__result);
981 __returnValue = y; 980 __returnValue = y;
982 // goto return 981 // goto return
983 __goto = 1; 982 __goto = 1;
984 break; 983 break;
985 case 14: 984 case 14:
986 // case 985 // case
987 if (a) { 986 if (a)
988 throw new Error(); 987 throw new Error();
989 } else { 988 else {
990 // goto while condition 989 // goto while condition
991 __goto = 3; 990 __goto = 3;
992 break; 991 break;
993 } 992 }
994 case 15: 993 case 15:
995 // default 994 // default
996 // goto break lab 995 // goto break lab
997 __goto = 6; 996 __goto = 6;
998 break; 997 break;
999 case 9: 998 case 9:
(...skipping 10 matching lines...) Expand all
1010 // return 1009 // return
1011 return thenHelper(__returnValue, 0, __completer, null); 1010 return thenHelper(__returnValue, 0, __completer, null);
1012 case 2: 1011 case 2:
1013 // rethrow 1012 // rethrow
1014 return thenHelper(__currentError, 1, __completer); 1013 return thenHelper(__currentError, 1, __completer);
1015 } 1014 }
1016 } 1015 }
1017 return thenHelper(null, __body, __completer, null); 1016 return thenHelper(null, __body, __completer, null);
1018 }"""); 1017 }""");
1019 } 1018 }
OLDNEW
« no previous file with comments | « pkg/js_ast/lib/src/printer.dart ('k') | tests/compiler/dart2js/js_parser_statements_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698