| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |