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

Unified Diff: pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart

Issue 923013002: dart2dart: Implementation of simple try/catch. (Closed) Base URL: https://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
Index: pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
index 038ecf16120824c81aacf5644c2f79038439cf0b..9decc3586a22acd4930d4abe43b94c92b7ea1bf9 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
@@ -560,6 +560,25 @@ class ExpressionStatement extends Statement {
}
}
+// TODO(kmillikin): Do we want this 'TryStatement'? Other than
+// LabeledStatement and EmptyStatement, the statement class names are not
+// suffixed with 'Statement'.
+class TryStatement extends Statement {
floitsch 2015/02/16 14:54:07 Try should be good enough.
Kevin Millikin (Google) 2015/02/25 11:06:36 Done.
+ Statement tryBody;
+ List<Variable> catchParameters;
+ Statement catchBody;
+
+ Statement get next => null;
+ void set next(Statement s) => throw 'UNREACHABLE';
+
+ TryStatement(this.tryBody, this.catchParameters, this.catchBody);
+
+ accept(StatementVisitor visitor) => visitor.visitTryStatement(this);
+ accept1(StatementVisitor1 visitor, arg) {
+ return visitor.visitTryStatement(this, arg);
+ }
+}
+
abstract class ExecutableDefinition {
ExecutableElement get element;
Statement body;
@@ -758,6 +777,7 @@ abstract class StatementVisitor<S> {
S visitWhileCondition(WhileCondition node);
S visitFunctionDeclaration(FunctionDeclaration node);
S visitExpressionStatement(ExpressionStatement node);
+ S visitTryStatement(TryStatement node);
S visitSetField(SetField node);
}
@@ -773,6 +793,7 @@ abstract class StatementVisitor1<S, A> {
S visitWhileCondition(WhileCondition node, A arg);
S visitFunctionDeclaration(FunctionDeclaration node, A arg);
S visitExpressionStatement(ExpressionStatement node, A arg);
+ S visitTryStatement(TryStatement node, A arg);
S visitSetField(SetField node, A arg);
}
@@ -902,6 +923,11 @@ class RecursiveVisitor extends Visitor {
visitStatement(node.next);
}
+ visitTryStatement(TryStatement node) {
+ visitStatement(node.tryBody);
+ visitStatement(node.catchBody);
+ }
+
visitFieldInitializer(FieldInitializer node) {
visitStatement(node.body);
}

Powered by Google App Engine
This is Rietveld 408576698