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

Unified Diff: runtime/vm/ast_transformer.cc

Issue 1017753003: Fix issue 22875 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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 | tests/language/await_postfix_expr_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast_transformer.cc
===================================================================
--- runtime/vm/ast_transformer.cc (revision 44546)
+++ runtime/vm/ast_transformer.cc (working copy)
@@ -601,12 +601,13 @@
void AwaitTransformer::VisitLetNode(LetNode* node) {
- // Add all the initializer nodes and their temporary variables
- // to the preamble. The temporary variables will be captured
- // as a side effect of being added to a scope, and the subsequent
- // nodes that are added to the preample can access them.
+ // Add all the initializer nodes to the preamble and the
+ // temporary variables to the scope for async temporary variables.
+ // The temporary variables will be captured as a side effect of being
+ // added to a scope, and the subsequent nodes that are added to the
+ // preample can access them.
for (intptr_t i = 0; i < node->num_temps(); i++) {
- preamble_->scope()->AddVariable(node->TempAt(i));
+ function_top_->AddVariable(node->TempAt(i));
AstNode* new_init_val = Transform(node->InitializerAt(i));
preamble_->Add(new(Z) StoreLocalNode(node->token_pos(),
node->TempAt(i),
« no previous file with comments | « no previous file | tests/language/await_postfix_expr_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698