babel-parser(flow): Set this property to null for FunctionTypeAnnotation without parens (#12930)

* Add null property to FunctionTypeAnnotation without parens

* Update tests

* Update tests
This commit is contained in:
Sosuke Suzuki
2021-03-01 23:15:43 +09:00
committed by GitHub
parent 265424d43f
commit b62fc3d44f
13 changed files with 388 additions and 374 deletions

View File

@@ -1649,6 +1649,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
const node = this.startNodeAt(param.start, param.loc.start);
node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
node.rest = null;
node.this = null;
node.returnType = this.flowParseType();
node.typeParameters = null;
return this.finishNode(node, "FunctionTypeAnnotation");