diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index bc9ce0972..4c9b80da2 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -787,6 +787,14 @@ pub struct CallExpression<'a> { } impl<'a> CallExpression<'a> { + pub fn callee_name(&self) -> Option<&str> { + match &self.callee { + Expression::Identifier(ident) => Some(ident.name.as_str()), + Expression::MemberExpression(member) => member.static_property_name(), + _ => None, + } + } + pub fn is_require_call(&self) -> bool { if self.arguments.len() != 1 { return false;