SD
SWC Developers•6mo ago
w00t

what happened with swc_ecmascript::visit::visit_expr?

I can't find the PR nor commit that removed it, nor any discussions. It's no longer exported and I don't know what to replace it with. My code is
impl Visit for IdentCollector {
noop_visit_type!();

fn visit_expr(&mut self, node: &ast::Expr) {
self.expr_ctxt.push(ExprOrSkip::Expr);
visit_expr(self, node);
self.expr_ctxt.pop();
}
...
impl Visit for IdentCollector {
noop_visit_type!();

fn visit_expr(&mut self, node: &ast::Expr) {
self.expr_ctxt.push(ExprOrSkip::Expr);
visit_expr(self, node);
self.expr_ctxt.pop();
}
...
7 Replies
kdy1
kdy1•6mo ago
node.visit_children_with(self) will work
w00t
w00tOP•6mo ago
ah excellent, thanks!
kdy1
kdy1•6mo ago
w00t
w00tOP•6mo ago
Can I ask you how you found this? I searched for "swc visit_expr" and found only outdated links
kdy1
kdy1•6mo ago
The rustdoc for SWC is published at https://rustdoc.swc.rs/swc
swc - Rust
The main crate of the swc project.
kdy1
kdy1•6mo ago
You can search from there
w00t
w00tOP•6mo ago
aha ok, I did find that page but couldn't interpret the results from the search. Thanks! Newbie here 🙂

Did you find this page helpful?