| 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:collection'; |
| 7 import "dart:math" show max; | 8 import "dart:math" show max; |
| 8 import 'dart:collection'; | |
| 9 | 9 |
| 10 import 'package:js_runtime/shared/async_await_error_codes.dart' as error_codes; | 10 import 'package:js_runtime/shared/async_await_error_codes.dart' as error_codes; |
| 11 | 11 |
| 12 import "js.dart" as js; | |
| 13 | |
| 14 import '../common.dart'; | 12 import '../common.dart'; |
| 15 import '../util/util.dart' show Pair; | 13 import '../util/util.dart' show Pair; |
| 14 import "js.dart" as js; |
| 16 | 15 |
| 17 /// Rewrites a [js.Fun] with async/sync*/async* functions and await and yield | 16 /// Rewrites a [js.Fun] with async/sync*/async* functions and await and yield |
| 18 /// (with dart-like semantics) to an equivalent function without these. | 17 /// (with dart-like semantics) to an equivalent function without these. |
| 19 /// await-for is not handled and must be rewritten before. (Currently handled | 18 /// await-for is not handled and must be rewritten before. (Currently handled |
| 20 /// in ssa/builder.dart). | 19 /// in ssa/builder.dart). |
| 21 /// | 20 /// |
| 22 /// When generating the input to this, special care must be taken that | 21 /// When generating the input to this, special care must be taken that |
| 23 /// parameters to sync* functions that are mutated in the body must be boxed. | 22 /// parameters to sync* functions that are mutated in the body must be boxed. |
| 24 /// (Currently handled in closure.dart). | 23 /// (Currently handled in closure.dart). |
| 25 /// | 24 /// |
| (...skipping 2562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2588 return condition || body; | 2587 return condition || body; |
| 2589 } | 2588 } |
| 2590 | 2589 |
| 2591 @override | 2590 @override |
| 2592 bool visitDartYield(js.DartYield node) { | 2591 bool visitDartYield(js.DartYield node) { |
| 2593 hasYield = true; | 2592 hasYield = true; |
| 2594 visit(node.expression); | 2593 visit(node.expression); |
| 2595 return true; | 2594 return true; |
| 2596 } | 2595 } |
| 2597 } | 2596 } |
| OLD | NEW |