OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 // VMOptions=--causal_async_stacks | 4 // VMOptions=--causal_async_stacks |
5 | 5 |
6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
7 | 7 |
8 baz() async { | 8 baz() async { |
9 throw "Bad!"; | 9 throw "Bad!"; |
10 } | 10 } |
11 | 11 |
12 bar() async { | 12 bar() async { |
13 await baz(); | 13 await baz(); |
14 } | 14 } |
15 | 15 |
16 foo() async { | 16 foo() async { |
17 await bar(); | 17 await bar(); |
18 } | 18 } |
19 | 19 |
20 main() async { | 20 main() async { |
21 try { | 21 try { |
22 await foo(); | 22 await foo(); |
23 } catch (e, st) { | 23 } catch (e, st) { |
24 Expect.isTrue(st.toString().contains("baz")); | 24 Expect.isTrue(st.toString().contains("baz")); |
25 Expect.isTrue(st.toString().contains("bar")); | 25 Expect.isTrue(st.toString().contains("bar")); |
26 Expect.isTrue(st.toString().contains("foo")); | 26 Expect.isTrue(st.toString().contains("foo")); |
27 Expect.isTrue(st.toString().contains("main")); | 27 Expect.isTrue(st.toString().contains("main")); |
28 } | 28 } |
29 } | 29 } |
OLD | NEW |