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 import "dart:math" show max; | 7 import "dart:math" show max; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:_internal/compiler/js_lib/shared/async_await_error_codes.dart' | 10 import 'package:_internal/compiler/js_lib/shared/async_await_error_codes.dart' |
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 @override | 1176 @override |
1177 js.Expression visitLiteralNumber(js.LiteralNumber node) => node; | 1177 js.Expression visitLiteralNumber(js.LiteralNumber node) => node; |
1178 | 1178 |
1179 @override | 1179 @override |
1180 visitLiteralStatement(js.LiteralStatement node) => unsupported(node); | 1180 visitLiteralStatement(js.LiteralStatement node) => unsupported(node); |
1181 | 1181 |
1182 @override | 1182 @override |
1183 js.Expression visitLiteralString(js.LiteralString node) => node; | 1183 js.Expression visitLiteralString(js.LiteralString node) => node; |
1184 | 1184 |
1185 @override | 1185 @override |
| 1186 js.Expression visitStringConcatenation(js.StringConcatenation node) => node; |
| 1187 |
| 1188 @override |
1186 visitNamedFunction(js.NamedFunction node) { | 1189 visitNamedFunction(js.NamedFunction node) { |
1187 unsupported(node); | 1190 unsupported(node); |
1188 } | 1191 } |
1189 | 1192 |
1190 @override | 1193 @override |
| 1194 js.Expression visitDeferredExpression(js.DeferredExpression node) => node; |
| 1195 |
| 1196 @override |
| 1197 js.Expression visitDeferredNumber(js.DeferredNumber node) => node; |
| 1198 |
| 1199 @override |
| 1200 js.Expression visitDeferredString(js.DeferredString node) => node; |
| 1201 |
| 1202 @override |
1191 js.Expression visitNew(js.New node) { | 1203 js.Expression visitNew(js.New node) { |
1192 bool storeTarget = node.arguments.any(shouldTransform); | 1204 bool storeTarget = node.arguments.any(shouldTransform); |
1193 return withCallTargetExpression(node.target, (target) { | 1205 return withCallTargetExpression(node.target, (target) { |
1194 return withExpressions(node.arguments, (List<js.Expression> arguments) { | 1206 return withExpressions(node.arguments, (List<js.Expression> arguments) { |
1195 return new js.New(target, arguments); | 1207 return new js.New(target, arguments); |
1196 }); | 1208 }); |
1197 }, store: storeTarget); | 1209 }, store: storeTarget); |
1198 } | 1210 } |
1199 | 1211 |
1200 @override | 1212 @override |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2378 @override | 2390 @override |
2379 bool visitLabeledStatement(js.LabeledStatement node) { | 2391 bool visitLabeledStatement(js.LabeledStatement node) { |
2380 usedNames.add(node.label); | 2392 usedNames.add(node.label); |
2381 labelledStatements.add(node); | 2393 labelledStatements.add(node); |
2382 bool containsAwait = visit(node.body); | 2394 bool containsAwait = visit(node.body); |
2383 labelledStatements.removeLast(); | 2395 labelledStatements.removeLast(); |
2384 return containsAwait; | 2396 return containsAwait; |
2385 } | 2397 } |
2386 | 2398 |
2387 @override | 2399 @override |
| 2400 bool visitDeferredExpression(js.DeferredExpression node) { |
| 2401 return false; |
| 2402 } |
| 2403 |
| 2404 @override |
| 2405 bool visitDeferredNumber(js.DeferredNumber node) { |
| 2406 return false; |
| 2407 } |
| 2408 |
| 2409 @override |
| 2410 bool visitDeferredString(js.DeferredString node) { |
| 2411 return false; |
| 2412 } |
| 2413 |
| 2414 @override |
2388 bool visitLiteralBool(js.LiteralBool node) { | 2415 bool visitLiteralBool(js.LiteralBool node) { |
2389 return false; | 2416 return false; |
2390 } | 2417 } |
2391 | 2418 |
2392 @override | 2419 @override |
2393 bool visitLiteralExpression(js.LiteralExpression node) { | 2420 bool visitLiteralExpression(js.LiteralExpression node) { |
2394 return unsupported(node); | 2421 return unsupported(node); |
2395 } | 2422 } |
2396 | 2423 |
2397 @override | 2424 @override |
(...skipping 10 matching lines...) Expand all Loading... |
2408 bool visitLiteralStatement(js.LiteralStatement node) { | 2435 bool visitLiteralStatement(js.LiteralStatement node) { |
2409 return unsupported(node); | 2436 return unsupported(node); |
2410 } | 2437 } |
2411 | 2438 |
2412 @override | 2439 @override |
2413 bool visitLiteralString(js.LiteralString node) { | 2440 bool visitLiteralString(js.LiteralString node) { |
2414 return false; | 2441 return false; |
2415 } | 2442 } |
2416 | 2443 |
2417 @override | 2444 @override |
| 2445 bool visitStringConcatenation(js.StringConcatenation node) { |
| 2446 return true; |
| 2447 } |
| 2448 |
| 2449 @override |
2418 bool visitNamedFunction(js.NamedFunction node) { | 2450 bool visitNamedFunction(js.NamedFunction node) { |
2419 return false; | 2451 return false; |
2420 } | 2452 } |
2421 | 2453 |
2422 @override | 2454 @override |
2423 bool visitNew(js.New node) { | 2455 bool visitNew(js.New node) { |
2424 return visitCall(node); | 2456 return visitCall(node); |
2425 } | 2457 } |
2426 | 2458 |
2427 @override | 2459 @override |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2542 return condition || body; | 2574 return condition || body; |
2543 } | 2575 } |
2544 | 2576 |
2545 @override | 2577 @override |
2546 bool visitDartYield(js.DartYield node) { | 2578 bool visitDartYield(js.DartYield node) { |
2547 hasYield = true; | 2579 hasYield = true; |
2548 visit(node.expression); | 2580 visit(node.expression); |
2549 return true; | 2581 return true; |
2550 } | 2582 } |
2551 } | 2583 } |
OLD | NEW |