[7.0] Change for-await to use new AST (#5321)

This commit is contained in:
Daniel Tschinder
2017-02-15 23:29:09 +01:00
committed by Henry Zhu
parent ca78da6501
commit 7c62278dcd
6 changed files with 11 additions and 38 deletions

View File

@@ -84,10 +84,9 @@ const buildForXStatement = function (op) {
return function (node: Object) {
this.word("for");
this.space();
if (op === "await") {
if (op === "of" && node.await) {
this.word("await");
this.space();
op = "of";
}
this.token("(");
@@ -103,7 +102,6 @@ const buildForXStatement = function (op) {
export const ForInStatement = buildForXStatement("in");
export const ForOfStatement = buildForXStatement("of");
export const ForAwaitStatement = buildForXStatement("await");
export function DoWhileStatement(node: Object) {
this.word("do");