| 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"; |
| 8 class A {} |
| 7 | 9 |
| 8 foo() async { | 10 main() { |
| 9 try { | 11 try { |
| 10 await 1; | 12 print(id(new Duration(milliseconds: 10))); |
| 11 } catch(e) { | 13 print(id(3) ~/ new A()); |
| 14 } catch (e) { |
| 15 print("Error '$e' ${e.runtimeType}"); |
| 12 } | 16 } |
| 13 throw "error"; | |
| 14 } | 17 } |
| 15 | 18 |
| 16 main() async { | 19 @AssumeDynamic() |
| 17 var error = "no error"; | 20 @NoInline() |
| 18 try { | 21 id(x) => x; |
| 19 await foo(); | |
| 20 } catch (e) { | |
| 21 error = e; | |
| 22 } | |
| 23 Expect.equals("error", error); | |
| 24 } | |
| 25 | 22 |
| OLD | NEW |