Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: lib/src/js/printer.dart

Issue 1207313002: initial sync*, part of #221 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/src/js/printer.dart
diff --git a/lib/src/js/printer.dart b/lib/src/js/printer.dart
index d5cf9e1ef54845859a3778df3d0eb7b2198985de..c545073f2e25bbdc7321f2312f70e550795e9f8b 100644
--- a/lib/src/js/printer.dart
+++ b/lib/src/js/printer.dart
@@ -509,6 +509,7 @@ class Printer implements NodeVisitor {
void functionOut(Fun fun, Node name) {
out("function");
+ if (fun.isGenerator) out("*");
if (name != null) {
out(" ");
// Name must be a [Decl]. Therefore only test for primary expressions.
@@ -770,6 +771,12 @@ class Printer implements NodeVisitor {
visitSpread(Spread unary) => visitPrefix(unary);
+ visitYield(Yield yield) {
+ out(yield.star ? "yield* " : "yield ");
+ visitNestedExpression(yield.value, yield.precedenceLevel,
+ newInForInit: inForInit, newAtStatementBegin: false);
+ }
+
visitPostfix(Postfix postfix) {
visitNestedExpression(postfix.argument, LEFT_HAND_SIDE,
newInForInit: inForInit,
@@ -1032,6 +1039,8 @@ class Printer implements NodeVisitor {
out('get ');
} else if (node.isSetter) {
out('set ');
+ } else if (node.function.isGenerator) {
+ out('*');
}
propertyNameOut(node.name, inMethod: true);

Powered by Google App Engine
This is Rietveld 408576698