fix: corrects handling of newline after async with paren-less arrow function (#8830)
If async is followed by a newline, then a paren-less arrow function should be parsed as two expressions
This commit is contained in:
@@ -794,7 +794,12 @@ export default class ExpressionParser extends LValParser {
|
||||
) {
|
||||
this.next();
|
||||
return this.parseFunction(node, false, false, true);
|
||||
} else if (canBeArrow && id.name === "async" && this.match(tt.name)) {
|
||||
} else if (
|
||||
canBeArrow &&
|
||||
!this.canInsertSemicolon() &&
|
||||
id.name === "async" &&
|
||||
this.match(tt.name)
|
||||
) {
|
||||
const oldYield = this.state.yieldInPossibleArrowParameters;
|
||||
this.state.yieldInPossibleArrowParameters = null;
|
||||
const params = [this.parseIdentifier()];
|
||||
|
||||
Reference in New Issue
Block a user