Fix syntax error for getter and setter with ts and estree plugin (#12333)

This commit is contained in:
Sosuke Suzuki
2020-11-09 16:36:39 +09:00
committed by GitHub
parent 32279147e6
commit ad8a4d62fd
3 changed files with 209 additions and 1 deletions

View File

@@ -2791,7 +2791,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
method: N.ObjectMethod | N.ClassMethod,
): number {
const baseCount = super.getGetterSetterExpectedParamCount(method);
const firstParam = method.params[0];
const params = this.getObjectOrClassMethodParams(method);
const firstParam = params[0];
const hasContextParam =
firstParam &&
firstParam.type === "Identifier" &&