OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--optimization-counter-threshold=-1 --stacktrace-filter=completeErr
or --stress-async-stacks |
| 5 |
| 6 // Stress test for async stack traces. |
| 7 |
| 8 import 'dart:async'; |
| 9 import "package:expect/expect.dart"; |
| 10 |
| 11 class A { |
| 12 Future<List<int>> read() => new Future.error(123); |
| 13 } |
| 14 |
| 15 Future<A> haha() => new Future.microtask(() => new A()); |
| 16 |
| 17 Future<List<int>> mm() async => (await haha()).read(); |
| 18 |
| 19 foo() async => await mm(); |
| 20 |
| 21 main() async { |
| 22 var x; |
| 23 try { |
| 24 x = await foo(); |
| 25 } catch (e) { |
| 26 Expect.equals(123, e); |
| 27 return; |
| 28 } |
| 29 Expect.isTrue(false); |
| 30 } |
OLD | NEW |