2017-06-15 18:09:48 +00:00
|
|
|
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
2020-12-01 07:27:14 +00:00
|
|
|
//
|
|
|
|
// VMOptions=--lazy-async-stacks
|
2017-06-15 18:09:48 +00:00
|
|
|
|
2021-04-26 17:58:57 +00:00
|
|
|
// @dart = 2.9
|
|
|
|
|
2017-06-15 18:09:48 +00:00
|
|
|
import "package:expect/expect.dart";
|
|
|
|
|
2019-06-20 20:23:37 +00:00
|
|
|
noop() async => Future.value(null);
|
|
|
|
|
2017-06-15 18:09:48 +00:00
|
|
|
baz() async {
|
2019-06-20 20:23:37 +00:00
|
|
|
// Throw exception after the first continuation, when there is no
|
|
|
|
// original stack trace.
|
|
|
|
await noop();
|
2017-06-15 18:09:48 +00:00
|
|
|
throw "Bad!";
|
|
|
|
}
|
|
|
|
|
|
|
|
bar() async {
|
|
|
|
await baz();
|
|
|
|
}
|
|
|
|
|
|
|
|
foo() async {
|
|
|
|
await bar();
|
|
|
|
}
|
|
|
|
|
|
|
|
main() async {
|
|
|
|
try {
|
|
|
|
await foo();
|
|
|
|
} catch (e, st) {
|
|
|
|
Expect.isTrue(st.toString().contains("baz"));
|
|
|
|
Expect.isTrue(st.toString().contains("bar"));
|
|
|
|
Expect.isTrue(st.toString().contains("foo"));
|
|
|
|
Expect.isTrue(st.toString().contains("main"));
|
|
|
|
}
|
|
|
|
}
|