Make arrow functions to work with multiple args and flow return type (fixes T2422)

This commit is contained in:
Aliaksei Shytkin
2015-11-23 15:14:54 +03:00
parent 59ec2b2dfb
commit 5e987cd46e
3 changed files with 432 additions and 1 deletions

View File

@@ -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 {