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

Unified Diff: pkg/compiler/lib/src/js/builder.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/inferrer/simple_types_inferrer.dart ('k') | pkg/compiler/lib/src/js/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js/builder.dart
diff --git a/pkg/compiler/lib/src/js/builder.dart b/pkg/compiler/lib/src/js/builder.dart
index 917c0606778877e31f58c981d4ef7420e4ab2b65..0fa01cc01bef3bed461608af9e5591c026423b23 100644
--- a/pkg/compiler/lib/src/js/builder.dart
+++ b/pkg/compiler/lib/src/js/builder.dart
@@ -716,6 +716,8 @@ class MiniJsParser {
return new LiteralNull();
} else if (last == "function") {
return parseFunctionExpression();
+ } else if (last == "this") {
+ return new This();
} else {
return new VariableUse(last);
}
@@ -1116,9 +1118,12 @@ class MiniJsParser {
if (lastToken == 'default') error("Default outside switch.");
+ if (lastToken == 'yield') return parseYield();
+
if (lastToken == 'with') {
error('Not implemented in mini parser');
}
+
}
bool checkForInterpolatedStatement = lastCategory == HASH;
@@ -1153,6 +1158,13 @@ class MiniJsParser {
return new Return(expression);
}
+ Statement parseYield() {
+ bool hasStar = acceptString('*');
+ Expression expression = parseExpression();
+ expectSemicolon();
+ return new DartYield(expression, hasStar);
+ }
+
Statement parseThrow() {
if (skippedNewline) error('throw expression must be on same line');
Expression expression = parseExpression();
« no previous file with comments | « pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart ('k') | pkg/compiler/lib/src/js/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698