mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 12:51:57 +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) {
|
fn gather<F: FnMut(&str)>(&self, f: &mut F) {
|
||||||
match self {
|
match self {
|
||||||
MemberExpression::ComputedMemberExpression(expr) => {
|
MemberExpression::ComputedMemberExpression(expr) => {
|
||||||
expr.object.gather(f);
|
expr.gather(f);
|
||||||
expr.expression.gather(f);
|
|
||||||
}
|
}
|
||||||
MemberExpression::StaticMemberExpression(expr) => {
|
MemberExpression::StaticMemberExpression(expr) => {
|
||||||
expr.object.gather(f);
|
expr.gather(f);
|
||||||
expr.property.gather(f);
|
|
||||||
}
|
}
|
||||||
MemberExpression::PrivateFieldExpression(expr) => {
|
MemberExpression::PrivateFieldExpression(expr) => {
|
||||||
expr.object.gather(f);
|
expr.gather(f);
|
||||||
expr.field.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> {
|
impl<'a> GatherNodeParts<'a> for CallExpression<'a> {
|
||||||
fn gather<F: FnMut(&str)>(&self, f: &mut F) {
|
fn gather<F: FnMut(&str)>(&self, f: &mut F) {
|
||||||
self.callee.gather(f);
|
self.callee.gather(f);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue