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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 }, store: false); | 959 }, store: false); |
960 beginLabel(joinLabel); | 960 beginLabel(joinLabel); |
961 return new js.VariableUse(resultName); | 961 return new js.VariableUse(resultName); |
962 } | 962 } |
963 | 963 |
964 return withExpression2(node.left, node.right, | 964 return withExpression2(node.left, node.right, |
965 (left, right) => new js.Binary(node.op, left, right)); | 965 (left, right) => new js.Binary(node.op, left, right)); |
966 } | 966 } |
967 | 967 |
968 @override | 968 @override |
| 969 js.Expression visitBlob(js.Blob node) { |
| 970 return node; |
| 971 } |
| 972 |
| 973 @override |
969 void visitBlock(js.Block node) { | 974 void visitBlock(js.Block node) { |
970 for (js.Statement statement in node.statements) { | 975 for (js.Statement statement in node.statements) { |
971 visitStatement(statement); | 976 visitStatement(statement); |
972 } | 977 } |
973 } | 978 } |
974 | 979 |
975 @override | 980 @override |
976 void visitBreak(js.Break node) { | 981 void visitBreak(js.Break node) { |
977 js.Node target = analysis.targets[node]; | 982 js.Node target = analysis.targets[node]; |
978 if (!shouldTransform(target)) { | 983 if (!shouldTransform(target)) { |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1810 } | 1815 } |
1811 | 1816 |
1812 @override | 1817 @override |
1813 bool visitBinary(js.Binary node) { | 1818 bool visitBinary(js.Binary node) { |
1814 bool left = visit(node.left); | 1819 bool left = visit(node.left); |
1815 bool right = visit(node.right); | 1820 bool right = visit(node.right); |
1816 return left || right; | 1821 return left || right; |
1817 } | 1822 } |
1818 | 1823 |
1819 @override | 1824 @override |
| 1825 bool visitBlob(js.Blob node) { |
| 1826 return false; |
| 1827 } |
| 1828 |
| 1829 @override |
1820 bool visitBlock(js.Block node) { | 1830 bool visitBlock(js.Block node) { |
1821 bool containsAwait = false; | 1831 bool containsAwait = false; |
1822 for (js.Statement statement in node.statements) { | 1832 for (js.Statement statement in node.statements) { |
1823 if (visit(statement)) containsAwait = true; | 1833 if (visit(statement)) containsAwait = true; |
1824 } | 1834 } |
1825 return containsAwait; | 1835 return containsAwait; |
1826 } | 1836 } |
1827 | 1837 |
1828 @override | 1838 @override |
1829 bool visitBreak(js.Break node) { | 1839 bool visitBreak(js.Break node) { |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2140 loopsAndSwitches.removeLast(); | 2150 loopsAndSwitches.removeLast(); |
2141 return condition || body; | 2151 return condition || body; |
2142 } | 2152 } |
2143 | 2153 |
2144 @override | 2154 @override |
2145 bool visitDartYield(js.DartYield node) { | 2155 bool visitDartYield(js.DartYield node) { |
2146 visit(node.expression); | 2156 visit(node.expression); |
2147 return true; | 2157 return true; |
2148 } | 2158 } |
2149 } | 2159 } |
OLD | NEW |