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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.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/dart_backend/backend_ast_to_frontend_ast.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart
index d641b54e7e86e5a68c3ef8a9c62175fe082cf932..d314f54ebf8f700b5abfa9ae705b4c2863a393f7 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_to_frontend_ast.dart
@@ -93,6 +93,7 @@ class TreePrinter {
final Token whileToken = makeIdToken('while');
final Token ifToken = makeIdToken('if');
final Token elseToken = makeIdToken('else');
+ final Token awaitToken = makeIdToken('await');
final Token forToken = makeIdToken('for');
final Token inToken = makeIdToken('in');
final Token returnToken = makeIdToken('return');
@@ -416,7 +417,8 @@ class TreePrinter {
: makeType(exp.returnType),
makeFunctionModifiers(exp),
null, // initializers
- getOrSet);
+ getOrSet, // get/set
+ null); // async modifier
setElement(result, exp.element, exp);
} else if (exp is Identifier) {
precedence = CALLEE;
@@ -702,6 +704,7 @@ class TreePrinter {
left,
makeExpression(stmt.expression),
makeStatement(stmt.body, shortIf: shortIf),
+ awaitToken,
forToken,
inToken);
} else if (stmt is FunctionDeclaration) {
@@ -712,7 +715,8 @@ class TreePrinter {
stmt.returnType != null ? makeType(stmt.returnType) : null,
makeEmptyModifiers(),
null, // initializers
- null); // get/set
+ null, // get/set
+ null); // async modifier
setElement(function, stmt.function.element, stmt);
return new tree.FunctionDeclaration(function);
} else if (stmt is If) {
@@ -886,8 +890,9 @@ class TreePrinter {
null, // body
param.type == null ? null : makeType(param.type),
makeEmptyModifiers(), // TODO: Function parameter modifiers?
- null, // initializers
- null); // get/set
+ null, // initializers
+ null, // get/set
+ null); // async modifier
if (param.element != null) {
setElement(definition, param.element, param);
}

Powered by Google App Engine
This is Rietveld 408576698