| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 P.print(1); | 61 P.print(1); |
| 62 if (V.foo(false) === true) | 62 if (V.foo(false) === true) |
| 63 break; | 63 break; |
| 64 } | 64 } |
| 65 P.print(2); | 65 P.print(2); |
| 66 }"""), | 66 }"""), |
| 67 const TestEntry(""" | 67 const TestEntry(""" |
| 68 foo(a) { print(a); return a; } | 68 foo(a) { print(a); return a; } |
| 69 | 69 |
| 70 main() { | 70 main() { |
| 71 foo(false); |
| 71 if (foo(true)) { | 72 if (foo(true)) { |
| 72 print(1); | 73 print(1); |
| 73 } else { | 74 } else { |
| 74 print(2); | 75 print(2); |
| 75 } | 76 } |
| 76 print(3); | 77 print(3); |
| 77 }""", """ | 78 }""", """ |
| 78 function() { | 79 function() { |
| 80 V.foo(false); |
| 79 V.foo(true) ? P.print(1) : P.print(2); | 81 V.foo(true) ? P.print(1) : P.print(2); |
| 80 P.print(3); | 82 P.print(3); |
| 81 }"""), | 83 }"""), |
| 82 const TestEntry(""" | 84 const TestEntry(""" |
| 83 foo(a) { print(a); return a; } | 85 foo(a) { print(a); return a; } |
| 84 | 86 |
| 85 main() { | 87 main() { |
| 88 foo(false); |
| 86 if (foo(true)) { | 89 if (foo(true)) { |
| 87 print(1); | 90 print(1); |
| 88 print(1); | 91 print(1); |
| 89 } else { | 92 } else { |
| 90 print(2); | 93 print(2); |
| 91 print(2); | 94 print(2); |
| 92 } | 95 } |
| 93 print(3); | 96 print(3); |
| 94 }""", """ | 97 }""", """ |
| 95 function() { | 98 function() { |
| 99 V.foo(false); |
| 96 if (V.foo(true)) { | 100 if (V.foo(true)) { |
| 97 P.print(1); | 101 P.print(1); |
| 98 P.print(1); | 102 P.print(1); |
| 99 } else { | 103 } else { |
| 100 P.print(2); | 104 P.print(2); |
| 101 P.print(2); | 105 P.print(2); |
| 102 } | 106 } |
| 103 P.print(3); | 107 P.print(3); |
| 104 }"""), | 108 }"""), |
| 105 const TestEntry(""" | 109 const TestEntry(""" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 P.print(current1); | 171 P.print(current1); |
| 168 if ($length !== xs.length) | 172 if ($length !== xs.length) |
| 169 H.throwConcurrentModificationError(xs); | 173 H.throwConcurrentModificationError(xs); |
| 170 } | 174 } |
| 171 }"""), | 175 }"""), |
| 172 ]; | 176 ]; |
| 173 | 177 |
| 174 void main() { | 178 void main() { |
| 175 runTests(tests); | 179 runTests(tests); |
| 176 } | 180 } |
| OLD | NEW |