mirror of
https://github.com/swc-project/swc.git
synced 2024-12-01 09:52:57 +03:00
feat(es/hygiene): Drop syntax context (#4594)
This commit is contained in:
parent
c68dec9448
commit
6ac4a23aa2
@ -163,7 +163,17 @@ pub fn hygiene() -> impl Fold + VisitMut + 'static {
|
||||
///
|
||||
/// At third phase, we rename all identifiers in the queue.
|
||||
pub fn hygiene_with_config(config: Config) -> impl 'static + Fold + VisitMut {
|
||||
as_folder(chain!(unique_scope(), Hygiene { config }))
|
||||
as_folder(chain!(unique_scope(), Hygiene { config }, HygieneRemover))
|
||||
}
|
||||
|
||||
struct HygieneRemover;
|
||||
|
||||
impl VisitMut for HygieneRemover {
|
||||
noop_visit_mut_type!();
|
||||
|
||||
fn visit_mut_ident(&mut self, i: &mut Ident) {
|
||||
i.span.ctxt = Default::default();
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
|
Loading…
Reference in New Issue
Block a user