Chromium Code Reviews| Index: runtime/vm/ast.h |
| diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h |
| index 03d65a06f3561c9161e330c1ec2dadd0a08eb75a..9456c24368db6d7c11a3323889eb1d659760df64 100644 |
| --- a/runtime/vm/ast.h |
| +++ b/runtime/vm/ast.h |
| @@ -518,18 +518,21 @@ class PrimaryNode : public AstNode { |
| class ReturnNode : public AstNode { |
| public: |
| // Return from a void function returns the null object. |
| - explicit ReturnNode(intptr_t token_pos) |
| + explicit ReturnNode(intptr_t token_pos, LocalScope* return_scope) |
|
hausner
2014/08/12 20:03:56
I appreciate your attempt to use a long name, but
Michael Lippautz (Google)
2014/08/12 20:32:12
Done.
|
| : AstNode(token_pos), |
| value_(new LiteralNode(token_pos, Instance::ZoneHandle())), |
| inlined_finally_list_(), |
| - saved_return_value_var_(NULL) { } |
| + saved_return_value_var_(NULL), |
| + return_scope_(return_scope) { } |
| // Return from a non-void function. |
| ReturnNode(intptr_t token_pos, |
| - AstNode* value) |
| + AstNode* value, |
| + LocalScope* return_scope) |
| : AstNode(token_pos), |
| value_(value), |
| inlined_finally_list_(), |
| - saved_return_value_var_(NULL) { |
| + saved_return_value_var_(NULL), |
| + return_scope_(return_scope) { |
| ASSERT(value_ != NULL); |
| } |
| @@ -558,12 +561,15 @@ class ReturnNode : public AstNode { |
| } |
| } |
| + LocalScope* return_scope() const { return return_scope_; } |
| + |
| DECLARE_COMMON_NODE_FUNCTIONS(ReturnNode); |
| private: |
| AstNode* value_; |
| GrowableArray<InlinedFinallyNode*> inlined_finally_list_; |
| LocalVariable* saved_return_value_var_; |
| + LocalScope* return_scope_; |
| DISALLOW_COPY_AND_ASSIGN(ReturnNode); |
| }; |