OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 | 6 |
7 // Test to make sure the do/while loop exit condition is generated. | 7 // Test to make sure the do/while loop exit condition is generated. |
8 | 8 |
9 var global; | 9 var global; |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 var element; | 26 var element; |
27 do { | 27 do { |
28 element = array[0]; // bailout here | 28 element = array[0]; // bailout here |
29 if (element is Map) continue; | 29 if (element is Map) continue; |
30 if (element == null) break; | 30 if (element == null) break; |
31 } while (element != 2); | 31 } while (element != 2); |
32 return global[0]; // bailout here | 32 return global[0]; // bailout here |
33 } | 33 } |
34 } | 34 } |
35 | 35 |
36 | |
37 void main() { | 36 void main() { |
38 global = [2]; | 37 global = [2]; |
39 for (int i = 0; i < 2; i++) { | 38 for (int i = 0; i < 2; i++) { |
40 Expect.equals(2, new A().bar()); | 39 Expect.equals(2, new A().bar()); |
41 } | 40 } |
42 | 41 |
43 global = new Map(); | 42 global = new Map(); |
44 global[0] = 2; | 43 global[0] = 2; |
45 for (int i = 0; i < 2; i++) { | 44 for (int i = 0; i < 2; i++) { |
46 Expect.equals(2, new A().bar()); | 45 Expect.equals(2, new A().bar()); |
47 } | 46 } |
48 } | 47 } |
OLD | NEW |