Fix parsing typescript bodiless methods with the estree plugin also enabled (#9890)

This commit is contained in:
Devon Govett
2019-04-23 07:20:42 -07:00
committed by Brian Ng
parent 8ca99b9f09
commit 338853b5d3
4 changed files with 229 additions and 2 deletions

View File

@@ -220,7 +220,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
isAsync,
isConstructor,
allowsDirectSuper,
"MethodDefinition",
"ClassMethod",
true,
);
if (method.typeParameters) {
@@ -293,13 +293,15 @@ export default (superClass: Class<Parser>): Class<Parser> =>
isAsync,
isConstructor,
allowDirectSuper,
"FunctionExpression",
type,
inClassScope,
);
funcNode.type = "FunctionExpression";
delete funcNode.kind;
// $FlowIgnore
node.value = funcNode;
type = type === "ClassMethod" ? "MethodDefinition" : type;
return this.finishNode(node, type);
}