Chromium Code Reviews| 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:collection'; |
| 8 import 'dart:math' show max; | 8 import 'dart:math' show max; |
| 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; |
| (...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1820 {this.endOfIteration, | 1820 {this.endOfIteration, |
| 1821 this.newIterable, | 1821 this.newIterable, |
| 1822 this.yieldStarExpression, | 1822 this.yieldStarExpression, |
| 1823 this.uncaughtErrorExpression, | 1823 this.uncaughtErrorExpression, |
| 1824 String safeVariableName(String proposedName), | 1824 String safeVariableName(String proposedName), |
| 1825 js.Name bodyName}) | 1825 js.Name bodyName}) |
| 1826 : super(diagnosticListener, spannable, safeVariableName, bodyName); | 1826 : super(diagnosticListener, spannable, safeVariableName, bodyName); |
| 1827 | 1827 |
| 1828 /// Translates a yield/yield* in an sync*. | 1828 /// Translates a yield/yield* in an sync*. |
| 1829 /// | 1829 /// |
| 1830 /// `yield` in a sync* function just returns [value]. | 1830 /// `yield` in a sync* function just returns [lexeme]. |
| 1831 /// `yield*` wraps [value] in a [yieldStarExpression] and returns it. | 1831 /// `yield*` wraps [lexeme] in a [yieldStarExpression] and returns it. |
|
ahe
2017/03/10 07:26:11
I think this isn't related. But there's an opportu
danrubel
2017/03/11 22:10:38
Reverted.
| |
| 1832 @override | 1832 @override |
| 1833 void addYield(js.DartYield node, js.Expression expression) { | 1833 void addYield(js.DartYield node, js.Expression expression) { |
| 1834 if (node.hasStar) { | 1834 if (node.hasStar) { |
| 1835 addStatement( | 1835 addStatement( |
| 1836 new js.Return(new js.Call(yieldStarExpression, [expression]))); | 1836 new js.Return(new js.Call(yieldStarExpression, [expression]))); |
| 1837 } else { | 1837 } else { |
| 1838 addStatement(new js.Return(expression)); | 1838 addStatement(new js.Return(expression)); |
| 1839 } | 1839 } |
| 1840 } | 1840 } |
| 1841 | 1841 |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2592 return condition || body; | 2592 return condition || body; |
| 2593 } | 2593 } |
| 2594 | 2594 |
| 2595 @override | 2595 @override |
| 2596 bool visitDartYield(js.DartYield node) { | 2596 bool visitDartYield(js.DartYield node) { |
| 2597 hasYield = true; | 2597 hasYield = true; |
| 2598 visit(node.expression); | 2598 visit(node.expression); |
| 2599 return true; | 2599 return true; |
| 2600 } | 2600 } |
| 2601 } | 2601 } |
| OLD | NEW |