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

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: Implement new ssa-nodes in ssa-tracer. Created 5 years, 11 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: 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 3eeca5e3801960aef73f4a0ced1ccd323669403d..3b4bb1d92e8ed72e56c46584651cc572355b8eab 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 Yield(expression, hasStar);
+ }
+
Statement parseThrow() {
if (skippedNewline) error('throw expression must be on same line');
Expression expression = parseExpression();

Powered by Google App Engine
This is Rietveld 408576698