mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
feat(traverse): implement GatherNodeParts for member expression types (#7363)
`GatherNodeParts` was missing support for these types as entry points for collection.
This commit is contained in:
parent
c587dd3cd6
commit
234c7b9fef
1 changed files with 24 additions and 6 deletions
|
|
@ -218,21 +218,39 @@ impl<'a> GatherNodeParts<'a> for MemberExpression<'a> {
|
|||
fn gather<F: FnMut(&str)>(&self, f: &mut F) {
|
||||
match self {
|
||||
MemberExpression::ComputedMemberExpression(expr) => {
|
||||
expr.object.gather(f);
|
||||
expr.expression.gather(f);
|
||||
expr.gather(f);
|
||||
}
|
||||
MemberExpression::StaticMemberExpression(expr) => {
|
||||
expr.object.gather(f);
|
||||
expr.property.gather(f);
|
||||
expr.gather(f);
|
||||
}
|
||||
MemberExpression::PrivateFieldExpression(expr) => {
|
||||
expr.object.gather(f);
|
||||
expr.field.gather(f);
|
||||
expr.gather(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> GatherNodeParts<'a> for ComputedMemberExpression<'a> {
|
||||
fn gather<F: FnMut(&str)>(&self, f: &mut F) {
|
||||
self.object.gather(f);
|
||||
self.expression.gather(f);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> GatherNodeParts<'a> for StaticMemberExpression<'a> {
|
||||
fn gather<F: FnMut(&str)>(&self, f: &mut F) {
|
||||
self.object.gather(f);
|
||||
self.property.gather(f);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> GatherNodeParts<'a> for PrivateFieldExpression<'a> {
|
||||
fn gather<F: FnMut(&str)>(&self, f: &mut F) {
|
||||
self.object.gather(f);
|
||||
self.field.gather(f);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> GatherNodeParts<'a> for CallExpression<'a> {
|
||||
fn gather<F: FnMut(&str)>(&self, f: &mut F) {
|
||||
self.callee.gather(f);
|
||||
|
|
|
|||
Loading…
Reference in a new issue