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

Unified Diff: compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java

Issue 8247007: Detect re-throws outside of a catch block. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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 | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java
===================================================================
--- compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java (revision 375)
+++ compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java (working copy)
@@ -16,7 +16,17 @@
testStmt("x.y");
testStmt("x + 1.0");
testStmt("x.y()");
- testStmt("throw");
+ // rethrow is an error outside a catch block
+ String rethrow =
+ " m() {\n" +
+ " try {\n" +
+ " }\n" +
+ " catch (var e) {\n" +
+ " throw;\n" +
+ " }\n" +
+ " }\n";
+ testClassMemeber(rethrow);
+
testStmt("throw e");
testStmt("Array<String> strings");
}
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698