diff --git a/crates/oxc_ast/src/ast_impl/js.rs b/crates/oxc_ast/src/ast_impl/js.rs index d45871558e405..7927e5016561c 100644 --- a/crates/oxc_ast/src/ast_impl/js.rs +++ b/crates/oxc_ast/src/ast_impl/js.rs @@ -373,10 +373,11 @@ impl<'a> Expression<'a> { /// Is identifier or `a.b` expression where `a` is an identifier. pub fn is_entity_name_expression(&self) -> bool { - matches!(self.without_parentheses(), Expression::Identifier(_)) - // Special case: treat `this.B` like `this` was an identifier - || matches!(self.without_parentheses(), Expression::ThisExpression(_)) - || self.is_property_access_entity_name_expression() + // Special case: treat `this.B` like `this` was an identifier + matches!( + self.without_parentheses(), + Expression::Identifier(_) | Expression::ThisExpression(_) + ) || self.is_property_access_entity_name_expression() } /// `a.b` expression where `a` is an identifier.