Check if param is assignable when parsing arrow return type (#11992)
This commit is contained in:
@@ -1444,7 +1444,7 @@ export default class ExpressionParser extends LValParser {
|
||||
if (
|
||||
canBeArrow &&
|
||||
this.shouldParseArrow() &&
|
||||
(arrowNode = this.parseArrow(arrowNode))
|
||||
(arrowNode = this.parseArrow(arrowNode, exprList))
|
||||
) {
|
||||
if (!this.isAwaitAllowed() && !this.state.maybeInAsyncArrowHead) {
|
||||
this.state.awaitPos = oldAwaitPos;
|
||||
@@ -1500,7 +1500,10 @@ export default class ExpressionParser extends LValParser {
|
||||
return !this.canInsertSemicolon();
|
||||
}
|
||||
|
||||
parseArrow(node: N.ArrowFunctionExpression): ?N.ArrowFunctionExpression {
|
||||
parseArrow(
|
||||
node: N.ArrowFunctionExpression,
|
||||
exprList: N.Node[], // eslint-disable-line no-unused-vars
|
||||
): ?N.ArrowFunctionExpression {
|
||||
if (this.eat(tt.arrow)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user