Allow jsx to be the body of a typed arrow function (#595)

Fixes #593
This commit is contained in:
Nicolò Ribaudo
2017-06-28 16:17:51 +02:00
committed by Henry Zhu
parent 759266a2e8
commit 03b3b39b17
3 changed files with 206 additions and 1 deletions

View File

@@ -958,7 +958,8 @@ export default (superClass: Class<Parser>): Class<Parser> => class extends super
this.state.inType = true;
const type = this.flowParseUnionType();
this.state.inType = oldInType;
this.state.exprAllowed = false;
// noAnonFunctionType is true when parsing an arrow function
this.state.exprAllowed = this.state.noAnonFunctionType;
return type;
}