Chromium Code Reviews| 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); |
| } |