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

Unified Diff: runtime/vm/ast.h

Issue 460763002: Fix returning from async functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | « no previous file | runtime/vm/ast_printer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | runtime/vm/ast_printer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698