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

Unified Diff: runtime/vm/ast_transformer.h

Issue 520223002: Fix scoping async functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase + added comment Created 6 years, 3 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_transformer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast_transformer.h
diff --git a/runtime/vm/ast_transformer.h b/runtime/vm/ast_transformer.h
index 6fbd82bec598676dba00701d02493e7082fdbf26..0ec64eed0c799d36c8928908e700aafa44be2ca9 100644
--- a/runtime/vm/ast_transformer.h
+++ b/runtime/vm/ast_transformer.h
@@ -41,18 +41,8 @@ class AwaitTransformer : public AstNodeVisitor {
public:
AwaitTransformer(SequenceNode* preamble,
const Library& library,
- ParsedFunction* const parsed_function)
- : preamble_(preamble),
- temp_cnt_(0),
- library_(library),
- parsed_function_(parsed_function),
- isolate_(Isolate::Current()) {
- // We later on save the continuation context and modify the jump counter
- // from within the preamble context (in the FlowGraphBuilder). Look up the
- // needed variables to get their corresponding aliases.
- preamble->scope()->LookupVariable(Symbols::AwaitContextVar(), false);
- preamble->scope()->LookupVariable(Symbols::AwaitJumpVar(), false);
- }
+ ParsedFunction* const parsed_function,
+ LocalScope* function_top);
#define DECLARE_VISIT(BaseName) \
virtual void Visit##BaseName##Node(BaseName##Node* node);
@@ -69,6 +59,8 @@ class AwaitTransformer : public AstNodeVisitor {
AstNode* LazyTransform(const Token::Kind kind,
AstNode* new_left,
AstNode* right);
+ LocalScope* ChainNewScope(LocalScope* parent);
+ LocalVariable* GetVariableInScope(LocalScope* scope, const String& symbol);
void NextTempVar() { temp_cnt_++; }
@@ -79,6 +71,7 @@ class AwaitTransformer : public AstNodeVisitor {
AstNode* result_;
const Library& library_;
ParsedFunction* const parsed_function_;
+ LocalScope* function_top_;
Isolate* isolate_;
« no previous file with comments | « no previous file | runtime/vm/ast_transformer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698