Skip to content

Commit

Permalink
fix: integration between estree and privateIn
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Dec 3, 2020
1 parent 77ee958 commit 8e4fb27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/babel-parser/src/parser/expression.js
Expand Up @@ -1129,12 +1129,15 @@ export default class ExpressionParser extends LValParser {
node = (this.parseMaybePrivateName(true): N.PrivateName);
if (this.match(tt._in)) {
this.expectPlugin("privateIn");
this.classScope.usePrivateName(node.id.name, node.start);
this.classScope.usePrivateName(
this.getPrivateNameSV(node),
node.start,
);
} else if (this.hasPlugin("privateIn")) {
this.raise(
this.state.start,
Errors.PrivateInExpectedIn,
node.id.name,
this.getPrivateNameSV(node),
);
} else {
throw this.unexpected(start);
Expand Down

0 comments on commit 8e4fb27

Please sign in to comment.