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 19, 2021
1 parent b0e75e5 commit 654ab5a
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 @@ -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;
}
Expand Down

0 comments on commit 654ab5a

Please sign in to comment.