| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Dart test for capturing. | 4 // Dart test for capturing. |
| 5 | 5 |
| 6 // Regression test for issue 5991015. | 6 // Regression test for issue 5991015. |
| 7 // @static-clean |
| 7 | 8 |
| 8 class V { | 9 class V { |
| 9 | 10 |
| 11 notCalled(Function x) { return x(); } |
| 12 |
| 10 foofoo(x) { return x; } | 13 foofoo(x) { return x; } |
| 11 | 14 |
| 12 hoop(input, n) { | 15 hoop(input, n) { |
| 13 while (n-- > 0) { | 16 while (n-- > 0) { |
| 14 Expect.equals(5, input); | 17 Expect.equals(5, input); |
| 15 continue; // This continue statement must properly unchain the context. | 18 continue; // This continue statement must properly unchain the context. |
| 16 switch (input) { | 19 switch (input) { |
| 17 case 3: | 20 case 3: |
| 18 var values = foofoo; | 21 var values = foofoo; |
| 19 readPacked(() => values(input)); | 22 notCalled(() => values(input)); |
| 20 } | 23 } |
| 21 } | 24 } |
| 22 } | 25 } |
| 23 } | 26 } |
| 24 | 27 |
| 25 main() { | 28 main() { |
| 26 new V().hoop(5, 3); | 29 new V().hoop(5, 3); |
| 27 } | 30 } |
| OLD | NEW |