Chromium Code Reviews| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 | 50 |
| 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 L2: |
| 61 while (P.identical(V.foo(true), true)) { | 61 while (P.identical(V.foo(true), true)) { |
| 62 P.print(1); | 62 P.print(1); |
| 63 if (P.identical(V.foo(false), true)) | 63 if (P.identical(V.foo(false), true)) |
| 64 break L1; | 64 break L2; |
|
asgerf
2015/07/03 12:00:34
Reason for change:
Labels are currently numbered
| |
| 65 i = V.foo(i); | 65 i = V.foo(i); |
| 66 } | 66 } |
| 67 P.print(2); | 67 P.print(2); |
| 68 }"""), | 68 }"""), |
| 69 const TestEntry(""" | 69 const TestEntry(""" |
| 70 foo(a) => a; | 70 foo(a) => a; |
| 71 | 71 |
| 72 main() { | 72 main() { |
| 73 if (foo(true)) { | 73 if (foo(true)) { |
| 74 print(1); | 74 print(1); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 }""",""" | 126 }""",""" |
| 127 function() { | 127 function() { |
| 128 V.foo(); | 128 V.foo(); |
| 129 P.print("good"); | 129 P.print("good"); |
| 130 }"""), | 130 }"""), |
| 131 ]; | 131 ]; |
| 132 | 132 |
| 133 void main() { | 133 void main() { |
| 134 runTests(tests); | 134 runTests(tests); |
| 135 } | 135 } |
| OLD | NEW |