feat(es/hygiene): Drop syntax context (#4594)

This commit is contained in:
Donny/강동윤 2022-05-10 05:15:15 +09:00 committed by GitHub
parent c68dec9448
commit 6ac4a23aa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)]