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

Unified Diff: sdk/lib/_internal/compiler/implementation/typechecker.dart

Issue 14211008: Add support for rethrow and start treating throw <expr> as an expression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
Index: sdk/lib/_internal/compiler/implementation/typechecker.dart
diff --git a/sdk/lib/_internal/compiler/implementation/typechecker.dart b/sdk/lib/_internal/compiler/implementation/typechecker.dart
index 6e79532ed64f781212b99700015f0f2187d10778..62de10d4b444f959f6094345acd169e48e049a4c 100644
--- a/sdk/lib/_internal/compiler/implementation/typechecker.dart
+++ b/sdk/lib/_internal/compiler/implementation/typechecker.dart
@@ -586,6 +586,10 @@ class TypeCheckerVisitor implements Visitor<DartType> {
fail(node, 'internal error');
}
+ DartType visitRethrow(Rethrow node) {
+ return StatementType.RETURNING;
+ }
+
/** Dart Programming Language Specification: 11.10 Return */
DartType visitReturn(Return node) {
if (identical(node.getBeginToken().stringValue, 'native')) {
@@ -625,7 +629,7 @@ class TypeCheckerVisitor implements Visitor<DartType> {
}
DartType visitThrow(Throw node) {
- if (node.expression != null) analyze(node.expression);
+ analyze(node.expression);
return StatementType.RETURNING;
}

Powered by Google App Engine
This is Rietveld 408576698