| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 import "package:expect/expect.dart"; | |
| 6 import "package:async_helper/async_helper.dart"; | |
| 7 | |
| 8 then43() async { | |
| 9 label: | |
| 10 try { | |
| 11 return await 42; | |
| 12 } finally { | |
| 13 break label; | |
| 14 } | |
| 15 return await 43; | |
| 16 } | |
| 17 | |
| 18 then42() async { | |
| 19 label: | |
| 20 try { | |
| 21 return await 42; | |
| 22 } finally {} | |
| 23 return await 43; | |
| 24 } | |
| 25 | |
| 26 now43() { | |
| 27 label: | |
| 28 try { | |
| 29 return 42; | |
| 30 } finally { | |
| 31 break label; | |
| 32 } | |
| 33 return 43; | |
| 34 } | |
| 35 | |
| 36 now42() { | |
| 37 label: | |
| 38 try { | |
| 39 return 42; | |
| 40 } finally {} | |
| 41 return 43; | |
| 42 } | |
| 43 | |
| 44 test() async { | |
| 45 Expect.equals(42, await then42()); | |
| 46 Expect.equals(43, await then43()); | |
| 47 Expect.equals(42, now42()); | |
| 48 Expect.equals(43, now43()); | |
| 49 } | |
| 50 | |
| 51 main() { | |
| 52 asyncStart(); | |
| 53 test().then((_) => asyncEnd()); | |
| 54 } | |
| OLD | NEW |