mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
perf(parser): skip keyword checks for plain identifier expressions (#28371)
Skip keyword validation for plain identifier expressions. Related to #28303; no added inline annotations. AI-assisted implementation.
This commit is contained in:
1 parent
61303fb376
commit
455fc09fe5
1 file changed
+4
@@ -77,6 +77,10 @@ impl<'a, C: Config> ParserImpl<'a, C> {
|
||||
|
||||
/// `PrimaryExpression`: Identifier Reference
|
||||
pub(crate) fn parse_identifier_expression(&mut self) -> Expression<'a> {
|
||||
if self.at(Kind::Ident) {
|
||||
let (span, name) = self.parse_identifier_kind(Kind::Ident);
|
||||
return Expression::Identifier(IdentifierReference::boxed(span, name, self));
|
||||
}
|
||||
let ident = self.parse_identifier_reference();
|
||||
Expression::Identifier(self.alloc(ident))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user