fix: ExpressionBody should respect [In] parameter (#11931)

This commit is contained in:
Huáng Jùnliàng
2020-08-26 13:24:44 -04:00
committed by GitHub
parent 97075c9091
commit 2c60595342
5 changed files with 97 additions and 1 deletions

View File

@@ -2118,7 +2118,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;