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

Side by Side Diff: pkg/compiler/lib/src/js/rewrite_async.dart

Issue 909113002: Use a VariableUse instead of VariableDeclaration for left-hand side of (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library rewrite_async; 5 library rewrite_async;
6 6
7 // TODO(sigurdm): Throws in catch-handlers are handled wrong. 7 // TODO(sigurdm): Throws in catch-handlers are handled wrong.
8 // TODO(sigurdm): Avoid using variables in templates. It could blow up memory 8 // TODO(sigurdm): Avoid using variables in templates. It could blow up memory
9 // use. 9 // use.
10 10
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1606 @override 1606 @override
1607 void visitVariableDeclarationList(js.VariableDeclarationList node) { 1607 void visitVariableDeclarationList(js.VariableDeclarationList node) {
1608 // Declaration of local variables is hoisted outside the helper but the 1608 // Declaration of local variables is hoisted outside the helper but the
1609 // initialization is done here. 1609 // initialization is done here.
1610 for (js.VariableInitialization initialization in node.declarations) { 1610 for (js.VariableInitialization initialization in node.declarations) {
1611 js.VariableDeclaration declaration = initialization.declaration; 1611 js.VariableDeclaration declaration = initialization.declaration;
1612 localVariables.add(declaration); 1612 localVariables.add(declaration);
1613 if (initialization.value != null) { 1613 if (initialization.value != null) {
1614 withExpression(initialization.value, (js.Expression value) { 1614 withExpression(initialization.value, (js.Expression value) {
1615 addStatement(new js.ExpressionStatement( 1615 addStatement(new js.ExpressionStatement(
1616 new js.Assignment(declaration, value))); 1616 new js.Assignment(new js.VariableUse(declaration.name), value)));
1617 }, store: false); 1617 }, store: false);
1618 } 1618 }
1619 } 1619 }
1620 } 1620 }
1621 1621
1622 @override 1622 @override
1623 void visitVariableInitialization(js.VariableInitialization node) { 1623 void visitVariableInitialization(js.VariableInitialization node) {
1624 unreachable(node); 1624 unreachable(node);
1625 } 1625 }
1626 1626
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 loopsAndSwitches.removeLast(); 2144 loopsAndSwitches.removeLast();
2145 return condition || body; 2145 return condition || body;
2146 } 2146 }
2147 2147
2148 @override 2148 @override
2149 bool visitDartYield(js.DartYield node) { 2149 bool visitDartYield(js.DartYield node) {
2150 visit(node.expression); 2150 visit(node.expression);
2151 return true; 2151 return true;
2152 } 2152 }
2153 } 2153 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698