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

Unified Diff: pkg/compiler/lib/src/js/template.dart

Issue 839323003: Implementation of async-await transformation on js ast. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 5 years, 10 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
« no previous file with comments | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js/template.dart
diff --git a/pkg/compiler/lib/src/js/template.dart b/pkg/compiler/lib/src/js/template.dart
index ce57d09b8c7e2fe223d96c6d8cfcfc25f028c828..f08fe5239b4847576277eea271795f175b51ecae 100644
--- a/pkg/compiler/lib/src/js/template.dart
+++ b/pkg/compiler/lib/src/js/template.dart
@@ -435,6 +435,11 @@ class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
return (arguments) => new Return(makeExpression(arguments));
}
+ Instantiator visitDartYield(DartYield node) {
+ Instantiator makeExpression = visit(node.expression);
+ return (arguments) => new DartYield(makeExpression(arguments), node.hasStar);
+ }
+
Instantiator visitThrow(Throw node) {
Instantiator makeExpression = visit(node.expression);
return (arguments) => new Throw(makeExpression(arguments));
@@ -487,8 +492,11 @@ class InstantiatorGeneratorVisitor implements NodeVisitor<Instantiator> {
new FunctionDeclaration(makeName(arguments), makeFunction(arguments));
}
- Instantiator visitLabeledStatement(LabeledStatement node) =>
- TODO('visitLabeledStatement');
+ Instantiator visitLabeledStatement(LabeledStatement node) {
+ Instantiator makeBody = visit(node.body);
+ return (arguments) => new LabeledStatement(node.label, makeBody(arguments));
+ }
+
Instantiator visitLiteralStatement(LiteralStatement node) =>
TODO('visitLiteralStatement');
Instantiator visitBlob(Blob node) =>
« no previous file with comments | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698