OLD | NEW |
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 import "package:compiler/src/js_backend/js_backend.dart" show StringBackedName; | 8 import "package:compiler/src/js_backend/js_backend.dart" show StringBackedName; |
9 | 9 |
10 void testTransform(String source, String expected, AsyncRewriterBase rewriter) { | 10 void testTransform(String source, String expected, AsyncRewriterBase rewriter) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Function start | 66 // Function start |
67 closures = [new A.main_closure()]; | 67 closures = [new A.main_closure()]; |
68 __goto = 2; | 68 __goto = 2; |
69 return thenHelper(closures, body, __completer); | 69 return thenHelper(closures, body, __completer); |
70 case 2: | 70 case 2: |
71 // returning from await. | 71 // returning from await. |
72 v0 = __result; | 72 v0 = __result; |
73 v1 = 0; | 73 v1 = 0; |
74 if (v1 < 0 || v1 >= v0.length) | 74 if (v1 < 0 || v1 >= v0.length) |
75 H.ioore(v0, v1); | 75 H.ioore(v0, v1); |
76 else | |
77 ; | |
78 v2 = 4; | 76 v2 = 4; |
79 v3 = 2; | 77 v3 = 2; |
80 P.print(v0[v1].call$2(v2, v3)); | 78 P.print(v0[v1].call$2(v2, v3)); |
81 // implicit return | 79 // implicit return |
82 return thenHelper(null, 0, __completer, null); | 80 return thenHelper(null, 0, __completer, null); |
83 case 1: | 81 case 1: |
84 // rethrow | 82 // rethrow |
85 return thenHelper(__currentError, 1, __completer); | 83 return thenHelper(__currentError, 1, __completer); |
86 } | 84 } |
87 }); | 85 }); |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 // return | 1229 // return |
1232 return endOfIteration(); | 1230 return endOfIteration(); |
1233 case 2: | 1231 case 2: |
1234 // rethrow | 1232 // rethrow |
1235 return uncaughtError(__currentError); | 1233 return uncaughtError(__currentError); |
1236 } | 1234 } |
1237 }; | 1235 }; |
1238 }); | 1236 }); |
1239 }"""); | 1237 }"""); |
1240 } | 1238 } |
OLD | NEW |