OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013, 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 // Test that the full stacktrace in an error object matches the stacktrace |
| 5 // handed to the catch clause. |
| 6 library test.error_stacktrace; |
| 7 |
| 8 import "package:expect/expect.dart"; |
| 9 |
| 10 class C { |
| 11 // operator*(o) is missing to trigger a noSuchMethodError when a C object |
| 12 // is used in the multiplication below. |
| 13 } |
| 14 |
| 15 bar(c) => c * 4; |
| 16 foo(c) => bar(c); |
| 17 |
| 18 main() { |
| 19 try { |
| 20 var a = foo(new C()); |
| 21 } catch (e, s) { |
| 22 print(e); |
| 23 print("###"); |
| 24 print(e.stackTrace); |
| 25 print("###"); |
| 26 print(s); |
| 27 print("###"); |
| 28 Expect.isTrue(e is NoSuchMethodError); |
| 29 Expect.stringEquals(e.stackTrace.toString(), s.toString()); |
| 30 } |
| 31 } |
OLD | NEW |