Use this.isThisParam in typescript parser (#13163)

This commit is contained in:
Sosuke Suzuki 2021-04-16 11:18:24 +09:00 committed by Nicolò Ribaudo
parent c949660b34
commit b116865077

View File

@ -3067,10 +3067,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
const baseCount = super.getGetterSetterExpectedParamCount(method);
const params = this.getObjectOrClassMethodParams(method);
const firstParam = params[0];
const hasContextParam =
firstParam &&
firstParam.type === "Identifier" &&
firstParam.name === "this";
const hasContextParam = firstParam && this.isThisParam(firstParam);
return hasContextParam ? baseCount + 1 : baseCount;
}