Make arrow functions to work with multiple args and flow return type (fixes T2422)
This commit is contained in:
@@ -671,7 +671,8 @@ export default function (instance) {
|
||||
|
||||
if (canBeArrow && this.eat(tt.arrow)) {
|
||||
// ((lol): number => {});
|
||||
let func = this.parseArrowExpression(this.startNodeAt(startLoc, startPos), [node]);
|
||||
let params = node.type === "SequenceExpression" ? node.expressions : [node];
|
||||
let func = this.parseArrowExpression(this.startNodeAt(startLoc, startPos), params);
|
||||
func.returnType = typeCastNode.typeAnnotation;
|
||||
return func;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user