Skip to content

Commit

Permalink
fix: ExpressionBody should respect [In] parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Aug 7, 2020
1 parent 8ecfb78 commit 7a41d58
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/babel-parser/src/parser/expression.js
Expand Up @@ -2110,7 +2110,8 @@ export default class ExpressionParser extends LValParser {
this.state.inParameters = false;

if (isExpression) {
node.body = this.parseMaybeAssignAllowIn();
// https://tc39.es/ecma262/#prod-ExpressionBody
node.body = this.parseMaybeAssign();
this.checkParams(node, false, allowExpression, false);
} else {
const oldStrict = this.state.strict;
Expand Down
@@ -0,0 +1 @@
for (() => x in y;;);
@@ -0,0 +1,3 @@
{
"throws": "Unexpected token, expected \")\" (1:17)"
}

0 comments on commit 7a41d58

Please sign in to comment.