Skip to content

Commit aed407b

Browse files
committed
rename FnVisitor to ScopeCollector
1 parent f78373b commit aed407b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/swc.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ pub fn parse_with_swc(src: &str) -> Scopes {
2828
// dbg!(&syntax);
2929

3030
tracing::trace_span!("extracting scopes").in_scope(|| {
31-
let mut visitor = FnVisitor::new();
31+
let mut collector = ScopeCollector::new();
3232

33-
syntax.visit_children_with_path(&mut visitor, &mut Default::default());
33+
syntax.visit_children_with_path(&mut collector, &mut Default::default());
3434

35-
visitor.into_scopes()
35+
collector.into_scopes()
3636
})
3737
}
3838

@@ -41,11 +41,11 @@ pub(crate) fn convert_span(span: Span) -> Range<u32> {
4141
span.lo.0..span.hi.0
4242
}
4343

44-
struct FnVisitor {
44+
struct ScopeCollector {
4545
scopes: Scopes,
4646
}
4747

48-
impl FnVisitor {
48+
impl ScopeCollector {
4949
fn new() -> Self {
5050
Self { scopes: vec![] }
5151
}
@@ -57,7 +57,7 @@ impl FnVisitor {
5757

5858
use swc_ecma_visit::AstParentNodeRef as Parent;
5959

60-
impl VisitAstPath for FnVisitor {
60+
impl VisitAstPath for ScopeCollector {
6161
fn visit_arrow_expr<'ast: 'r, 'r>(
6262
&mut self,
6363
node: &'ast ast::ArrowExpr,

0 commit comments

Comments
 (0)