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

Unified Diff: sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart

Issue 675113002: Support async/await in the dart2js frontend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 6 years, 1 month 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: sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart
diff --git a/sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart b/sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart
index 93a3212e0a0d4c00a9a2469b13f476b39affe051..b0b1de18a63b01cc9d29796bcb5702495dfc38b7 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart
+++ b/sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart
@@ -121,6 +121,12 @@ class PrettyPrinter extends Indentation implements Visitor {
closeNode();
}
+ visitAsyncModifier(AsyncModifier node) {
+ openAndCloseNode(node, "AsyncModifier",
+ {'asyncToken': node.asyncToken,
+ 'starToken': node.starToken});
+ }
+
visitBlock(Block node) {
visitNodeWithChildren(node, "Block");
}
@@ -181,7 +187,9 @@ class PrettyPrinter extends Indentation implements Visitor {
}
visitForIn(ForIn node) {
- visitNodeWithChildren(node, "ForIn");
+ openNode(node, "ForIn", {'await': node.awaitToken});
+ node.visitChildren(this);
+ closeNode();
}
visitFunctionDeclaration(FunctionDeclaration node) {
@@ -318,6 +326,12 @@ class PrettyPrinter extends Indentation implements Visitor {
closeNode();
}
+ visitYield(Yield node) {
+ openNode(node, "Yield", {'star': node.starToken});
+ visitChildNode(node.expression, "expression");
+ closeNode();
+ }
+
visitChildNode(Node node, String fieldName) {
if (node == null) return;
addCurrentIndent();
@@ -381,6 +395,10 @@ class PrettyPrinter extends Indentation implements Visitor {
visitNodeWithChildren(node, "Throw");
}
+ visitAwait(Await node) {
+ visitNodeWithChildren(node, "Await");
+ }
+
visitTryStatement(TryStatement node) {
visitNodeWithChildren(node, "TryStatement");
}

Powered by Google App Engine
This is Rietveld 408576698