[7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349)
* Remove ForAwaitStatement, add await flag to ForOfStatement * Set await flag for all ForOfStatements
This commit is contained in:
@@ -530,14 +530,13 @@ pp.parseFor = function (node, init) {
|
||||
// same from parser's perspective.
|
||||
|
||||
pp.parseForIn = function (node, init, forAwait) {
|
||||
let type;
|
||||
const type = this.match(tt._in) ? "ForInStatement" : "ForOfStatement";
|
||||
if (forAwait) {
|
||||
this.eatContextual("of");
|
||||
type = "ForAwaitStatement";
|
||||
} else {
|
||||
type = this.match(tt._in) ? "ForInStatement" : "ForOfStatement";
|
||||
this.next();
|
||||
}
|
||||
node.await = !!forAwait;
|
||||
node.left = init;
|
||||
node.right = this.parseExpression();
|
||||
this.expect(tt.parenR);
|
||||
|
||||
Reference in New Issue
Block a user