Implement class features in estree (#12370)

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
This commit is contained in:
Huáng Jùnliàng
2021-02-21 14:12:12 -05:00
committed by GitHub
parent 9c567baa9b
commit 03d7911be6
26 changed files with 656 additions and 20 deletions

View File

@@ -1172,12 +1172,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);