Skip to content

Commit

Permalink
Use this.isThisParam in typescript parser (#13163)
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki authored and JLHwung committed Apr 17, 2021
1 parent ab05ac8 commit 4d58f86
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/babel-parser/src/plugins/typescript/index.js
Expand Up @@ -3061,10 +3061,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;
}
Expand Down

0 comments on commit 4d58f86

Please sign in to comment.