diff --git a/src/parser/statement.js b/src/parser/statement.js index 376c685147..53cbaacb77 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -535,7 +535,9 @@ export default class StatementParser extends ExpressionParser { } else { this.next(); } - node.await = !!forAwait; + if (type === "ForOfStatement") { + node.await = !!forAwait; + } node.left = init; node.right = this.parseExpression(); this.expect(tt.parenR); diff --git a/test/fixtures/core/uncategorised/246/expected.json b/test/fixtures/core/uncategorised/246/expected.json index 9c7cdebe0f..b49d510db1 100644 --- a/test/fixtures/core/uncategorised/246/expected.json +++ b/test/fixtures/core/uncategorised/246/expected.json @@ -42,7 +42,6 @@ "column": 26 } }, - "await": false, "left": { "type": "Identifier", "start": 4, diff --git a/test/fixtures/core/uncategorised/247/expected.json b/test/fixtures/core/uncategorised/247/expected.json index 4a3a0ecfda..59067a9ff1 100644 --- a/test/fixtures/core/uncategorised/247/expected.json +++ b/test/fixtures/core/uncategorised/247/expected.json @@ -42,7 +42,6 @@ "column": 31 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, diff --git a/test/fixtures/core/uncategorised/532/expected.json b/test/fixtures/core/uncategorised/532/expected.json index c86ced2dd6..20311af984 100644 --- a/test/fixtures/core/uncategorised/532/expected.json +++ b/test/fixtures/core/uncategorised/532/expected.json @@ -42,7 +42,6 @@ "column": 31 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, diff --git a/test/fixtures/es2015/uncategorised/310/expected.json b/test/fixtures/es2015/uncategorised/310/expected.json index facb5febd6..2e3b4faf28 100644 --- a/test/fixtures/es2015/uncategorised/310/expected.json +++ b/test/fixtures/es2015/uncategorised/310/expected.json @@ -42,7 +42,6 @@ "column": 21 } }, - "await": false, "left": { "type": "ObjectPattern", "start": 5, diff --git a/test/fixtures/es2015/uncategorised/323/expected.json b/test/fixtures/es2015/uncategorised/323/expected.json index 158a4615bd..b76d82ee86 100644 --- a/test/fixtures/es2015/uncategorised/323/expected.json +++ b/test/fixtures/es2015/uncategorised/323/expected.json @@ -42,7 +42,6 @@ "column": 33 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json b/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json index 69927b7511..85430cc73f 100644 --- a/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json @@ -42,7 +42,6 @@ "column": 18 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, diff --git a/test/fixtures/esprima/statement-iteration/const_forin/expected.json b/test/fixtures/esprima/statement-iteration/const_forin/expected.json index aea7786f71..094cbea3c2 100644 --- a/test/fixtures/esprima/statement-iteration/const_forin/expected.json +++ b/test/fixtures/esprima/statement-iteration/const_forin/expected.json @@ -42,7 +42,6 @@ "column": 33 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json index 9c7cdebe0f..b49d510db1 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json @@ -42,7 +42,6 @@ "column": 26 } }, - "await": false, "left": { "type": "Identifier", "start": 4, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json index 4a3a0ecfda..59067a9ff1 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json @@ -42,7 +42,6 @@ "column": 31 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json index c86ced2dd6..20311af984 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json @@ -42,7 +42,6 @@ "column": 31 } }, - "await": false, "left": { "type": "VariableDeclaration", "start": 5, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json index 9bb6c3e3fc..739ce79307 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json @@ -42,7 +42,6 @@ "column": 21 } }, - "await": false, "left": { "type": "MemberExpression", "start": 5, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json index a50e44182a..190164f5b4 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json @@ -42,7 +42,6 @@ "column": 24 } }, - "await": false, "left": { "type": "MemberExpression", "start": 5, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json index dc3c4e3104..9cbe245b30 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json @@ -42,7 +42,6 @@ "column": 16 } }, - "await": false, "left": { "type": "MemberExpression", "start": 5,