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

Unified Diff: tests/language/stack_trace_test.dart

Issue 23691024: If a rethrow is encountered in the catch block, then its handler must be marked that it needs stack… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/stack_trace_test.dart
===================================================================
--- tests/language/stack_trace_test.dart (revision 26962)
+++ tests/language/stack_trace_test.dart (working copy)
@@ -83,6 +83,57 @@
}
}
+
+// Test that the full stack trace is generated for rethrow.
+class RethrowStacktraceTest {
+ var config = 0;
+
+ issue12940() {
+ throw "Progy";
+ }
+
+ b() {
+ issue12940();
+ }
+
+ c() {
+ if (config == 0) {
+ try {
+ b();
+ } catch (e) {
+ rethrow;
+ }
+ } else {
+ try {
+ b();
+ } catch (e, s) {
+ rethrow;
+ }
+ }
+ }
+
+ d() {
+ c();
+ }
+
+ testBoth() {
+ for (config = 0; config < 2; config++) {
+ try {
+ d();
+ } catch (e, s) {
+ Expect.isTrue(s.toString().contains("issue12940"));
+ }
+ }
+ }
+
+ static testMain() {
+ var test = new RethrowStacktraceTest();
+ test.testBoth();
+ }
+}
+
+
main() {
StackTraceTest.testMain();
+ RethrowStacktraceTest.testMain();
}
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698