Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Unified Diff: tests/language/custom_await_stack_trace_test.dart

Issue 940863002: - Allow any implementation of StackTrace to participate in async/ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/custom_await_stack_trace_test.dart
===================================================================
--- tests/language/custom_await_stack_trace_test.dart (revision 0)
+++ tests/language/custom_await_stack_trace_test.dart (working copy)
@@ -0,0 +1,29 @@
+import "dart:async";
+import "package:expect/expect.dart";
+
+class Blah extends StackTrace {
+ Blah(this._trace);
+
+ toString() {
+ return "Blah " + _trace.toString();
+ }
+
+ var _trace;
+}
+
+foo() {
+ var x = "\nBloop\nBleep\n";
+ return new Future.error(42, new Blah(x));
+}
+
+main() async {
+ try {
+ var x = await foo();
+ Expect.fail("Should not reach here.");
+ } on int catch (e, s) {
+ Expect.equals(42, e);
+ Expect.equals("Blah \nBloop\nBleep\n", s.toString());
+ return;
+ }
+ Expect.fail("Unreachable.");
+}
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698