| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 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 | 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 "dart:async"; | 5 // Regression test for http://dartbug.com/22776/ |
| 6 |
| 6 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 7 | 8 |
| 8 foo() async { | 9 class A {} |
| 10 |
| 11 main() { |
| 9 try { | 12 try { |
| 10 await 1; | 13 print(id(new Duration(milliseconds: 10))); |
| 11 } catch(e) { | 14 print(id(3) ~/ new A()); |
| 15 } catch (e) { |
| 16 print("Error '$e' ${e.runtimeType}"); |
| 12 } | 17 } |
| 13 throw "error"; | |
| 14 } | 18 } |
| 15 | 19 |
| 16 main() async { | 20 @AssumeDynamic() |
| 17 var error = "no error"; | 21 @NoInline() |
| 18 try { | 22 id(x) => x; |
| 19 await foo(); | |
| 20 } catch (e) { | |
| 21 error = e; | |
| 22 } | |
| 23 Expect.equals("error", error); | |
| 24 } | |
| 25 | 23 |
| OLD | NEW |