OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 | |
5 // Test correct source positions in stack trace with optimized functions. | 4 // Test correct source positions in stack trace with optimized functions. |
| 5 import "package:expect/expect.dart"; |
6 | 6 |
7 // (1) Test normal exception. | 7 // (1) Test normal exception. |
8 foo(x) => bar(x); | 8 foo(x) => bar(x); |
9 | 9 |
10 bar(x) { | 10 bar(x) { |
11 if (x == null) throw 42; // throw at position 11:18 | 11 if (x == null) throw 42; // throw at position 11:18 |
12 return x + 1; | 12 return x + 1; |
13 } | 13 } |
14 | 14 |
15 test1() { | 15 test1() { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 Expect.notEquals(-1, s.indexOf("maximus")); | 69 Expect.notEquals(-1, s.indexOf("maximus")); |
70 Expect.notEquals(-1, s.indexOf("moritz")); | 70 Expect.notEquals(-1, s.indexOf("moritz")); |
71 Expect.equals(-1, s.indexOf("-1:-1")); | 71 Expect.equals(-1, s.indexOf("-1:-1")); |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
75 main() { | 75 main() { |
76 test1(); | 76 test1(); |
77 test2(); | 77 test2(); |
78 } | 78 } |
OLD | NEW |