| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // Tests of control flow statements. | 5 // Tests of control flow statements. |
| 6 | 6 |
| 7 library control_flow_tests; | 7 library control_flow_tests; |
| 8 | 8 |
| 9 import 'js_backend_cps_ir.dart'; | 9 import 'js_backend_cps_ir.dart'; |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 main() { | 51 main() { |
| 52 for (int i = 0; foo(true); i = foo(i)) { | 52 for (int i = 0; foo(true); i = foo(i)) { |
| 53 print(1); | 53 print(1); |
| 54 if (foo(false)) break; | 54 if (foo(false)) break; |
| 55 } | 55 } |
| 56 print(2); | 56 print(2); |
| 57 }""", """ | 57 }""", """ |
| 58 function() { | 58 function() { |
| 59 var i = 0; | 59 var i = 0; |
| 60 L1: | 60 L1: |
| 61 while (true) { | 61 while (P.identical(V.foo(true), true)) { |
| 62 if (P.identical(V.foo(true), true)) { | 62 P.print(1); |
| 63 P.print(1); | 63 if (!P.identical(V.foo(false), true)) |
| 64 if (!P.identical(V.foo(false), true)) { | 64 i = V.foo(i); |
| 65 i = V.foo(i); | 65 else |
| 66 continue L1; | 66 break L1; |
| 67 } | |
| 68 } | |
| 69 P.print(2); | |
| 70 return null; | |
| 71 } | 67 } |
| 68 P.print(2); |
| 69 return null; |
| 72 }"""), | 70 }"""), |
| 73 const TestEntry(""" | 71 const TestEntry(""" |
| 74 foo(a) => a; | 72 foo(a) => a; |
| 75 | 73 |
| 76 main() { | 74 main() { |
| 77 if (foo(true)) { | 75 if (foo(true)) { |
| 78 print(1); | 76 print(1); |
| 79 } else { | 77 } else { |
| 80 print(2); | 78 print(2); |
| 81 } | 79 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 }""",""" | 131 }""",""" |
| 134 function() { | 132 function() { |
| 135 P.identical(V.foo(), true) ? P.print("bad") : P.print("good"); | 133 P.identical(V.foo(), true) ? P.print("bad") : P.print("good"); |
| 136 return null; | 134 return null; |
| 137 }"""), | 135 }"""), |
| 138 ]; | 136 ]; |
| 139 | 137 |
| 140 void main() { | 138 void main() { |
| 141 runTests(tests); | 139 runTests(tests); |
| 142 } | 140 } |
| OLD | NEW |