Skip to content

Commit

Permalink
Fix flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Oct 24, 2021
1 parent 73151fc commit 8e81cf0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/babel-parser/src/parser/statement.js
Expand Up @@ -1717,7 +1717,10 @@ export default class StatementParser extends ExpressionParser {
this.declareClassPrivateMethodInScope(node, kind);
}

declareClassPrivateMethodInScope(node: N.ClassPrivateMethod, kind: number) {
declareClassPrivateMethodInScope(
node: N.ClassPrivateMethod | N.EstreeMethodDefinition | N.TSDeclareMethod,
kind: number,
) {
this.classScope.declarePrivateName(
this.getPrivateNameSV(node.key),
kind,
Expand Down
5 changes: 4 additions & 1 deletion packages/babel-parser/src/plugins/typescript/index.js
Expand Up @@ -2755,7 +2755,10 @@ export default (superClass: Class<Parser>): Class<Parser> =>
super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
}

declareClassPrivateMethodInScope(node: N.ClassPrivateMethod, kind: number) {
declareClassPrivateMethodInScope(
node: N.ClassPrivateMethod | N.EstreeMethodDefinition | N.TSDeclareMethod,
kind: number,
) {
if (node.type === "TSDeclareMethod") return;
// This happens when using the "estree" plugin.
if (node.type === "MethodDefinition" && !node.value.body) return;
Expand Down

0 comments on commit 8e81cf0

Please sign in to comment.