(
this: Parser,
member: Undone<N.ClassMember>,
)
| 1970 | |
| 1971 | // https://tc39.es/ecma262/#prod-ClassElementName |
| 1972 | parseClassElementName( |
| 1973 | this: Parser, |
| 1974 | member: Undone<N.ClassMember>, |
| 1975 | ): N.Expression | N.Identifier | N.PrivateName { |
| 1976 | const { type, value } = this.state; |
| 1977 | if ( |
| 1978 | (type === tt.name || type === tt.string) && |
| 1979 | member.static && |
| 1980 | value === "prototype" |
| 1981 | ) { |
| 1982 | this.raise(Errors.StaticPrototype, this.state.startLoc); |
| 1983 | } |
| 1984 | |
| 1985 | if (type === tt.privateName) { |
| 1986 | if (value === "constructor") { |
| 1987 | this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc); |
| 1988 | } |
| 1989 | const key = this.parsePrivateName(); |
| 1990 | member.key = key; |
| 1991 | return key; |
| 1992 | } |
| 1993 | |
| 1994 | this.parsePropertyName(member); |
| 1995 | return member.key; |
| 1996 | } |
| 1997 | |
| 1998 | parseClassStaticBlock( |
| 1999 | this: Parser, |
nothing calls this directly
no test coverage detected