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 // VMOptions=--enable_async --optimization-counter-threshold=10 | 5 // VMOptions=--optimization-counter-threshold=10 |
6 | 6 |
7 // This tests that captured parameters (by the async-closure) are | 7 // This tests that captured parameters (by the async-closure) are |
8 // correctly treated in try-catch generated in the async function. | 8 // correctly treated in try-catch generated in the async function. |
9 // They must be skipped when generating sync-code in the optimized | 9 // They must be skipped when generating sync-code in the optimized |
10 // try-block. | 10 // try-block. |
11 | 11 |
12 import 'package:expect/expect.dart'; | 12 import 'package:expect/expect.dart'; |
13 | 13 |
14 import 'dart:async'; | 14 import 'dart:async'; |
15 | 15 |
(...skipping 16 matching lines...) Expand all Loading... |
32 if (a != "abc77") fail(); | 32 if (a != "abc77") fail(); |
33 return k; | 33 return k; |
34 } | 34 } |
35 | 35 |
36 | 36 |
37 main() { | 37 main() { |
38 for (int i = 0; i < 20; i++) { | 38 for (int i = 0; i < 20; i++) { |
39 foo(i).then((value) => Expect.equals(77, value)); | 39 foo(i).then((value) => Expect.equals(77, value)); |
40 } | 40 } |
41 } | 41 } |
OLD | NEW |