OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 'expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 | 6 |
7 // Test that the context depth is correct in the presence of control flow, | 7 // Test that the context depth is correct in the presence of control flow, |
8 // specifically branching and joining in the presence of break. The | 8 // specifically branching and joining in the presence of break. The |
9 // implementation uses the context depth after the else block of an if/then/else | 9 // implementation uses the context depth after the else block of an if/then/else |
10 // as the context depth at the join point. This test has an extra context | 10 // as the context depth at the join point. This test has an extra context |
11 // allocated in the (untaken) else branch so it tests that compiling the | 11 // allocated in the (untaken) else branch so it tests that compiling the |
12 // (untaken) break properly tracks the context depth. | 12 // (untaken) break properly tracks the context depth. |
13 | 13 |
14 test(list) { | 14 test(list) { |
15 // The loops force creation of a new context, otherwise context allocated | 15 // The loops force creation of a new context, otherwise context allocated |
(...skipping 22 matching lines...) Expand all Loading... |
38 } while (false); | 38 } while (false); |
39 } | 39 } |
40 } while (false); | 40 } while (false); |
41 Expect.isTrue(list.length == 5); | 41 Expect.isTrue(list.length == 5); |
42 } | 42 } |
43 | 43 |
44 | 44 |
45 main() { | 45 main() { |
46 test([1, 2, 3, 4, 5]); | 46 test([1, 2, 3, 4, 5]); |
47 } | 47 } |
OLD | NEW |