pub(super) fn replace_props(&mut self, e: &mut Expr) {
        let member = match e {
            Expr::Member(m) => m,
            _ => return,
        };
        if let Expr::Ident(obj) = &*member.obj {
            if let Some(value) = self.vars_for_prop_hoisting.remove(&obj.to_id()) {
                member.obj = value;
                self.changed = true;
                tracing::debug!("hoist_props: Inlined a property");
                return;
            }

            if let MemberProp::Ident(prop) = &member.prop {
                if let Some(value) = self.simple_props.get(&(obj.to_id(), prop.sym.clone())) {
                    tracing::debug!("hoist_props: Inlining `{}.{}`", obj.sym, prop.sym);
                    self.changed = true;
                    *e = *value.clone()
                }
            }
        }
    }
/// Replace property accesses to known values.
Replace property accesses to known values.
Replace property accesses to known values .
pub(super) fn replace_props(&mut self, e: &mut Expr) {
        let member = match e {
            Expr::Member(m) => m,
            _ => return,
        };
        if let Expr::Ident(obj) = &*member.obj {
            if let Some(value) = self.vars_for_prop_hoisting.remove(&obj.to_id()) {
                member.obj = value;
                self.changed = true;
                tracing::debug!("hoist_props: Inlined a property");
                return;
            }
            if let MemberProp::Ident(prop) = &member.prop {
                if let Some(value) = self.simple_props.get(&(obj.to_id(), prop.sym.clone())) {
                    tracing::debug!("hoist_props: Inlining `{}.{}`", obj.sym, prop.sym);
                    self.changed = true;
                    *e = *value.clone()
                }
            }
        }
    }
pub ( super ) fn replace_props ( & mut self , e : & mut Expr ) { let member = match e { Expr :: Member ( m ) => m , _ => return , } ; if let Expr :: Ident ( obj ) = & * member . obj { if let Some ( value ) = self . vars_for_prop_hoisting . remove ( & obj . to_id ( ) ) { member . obj = value ; self . changed = true ; tracing :: debug ! ( " " ) ; return ; } if let MemberProp :: Ident ( prop ) = & member . prop { if let Some ( value ) = self . simple_props . get ( & ( obj . to_id ( ) , prop . sym . clone ( ) ) ) { tracing :: debug ! ( " " obj sym prop sym ) ; self . changed = true ; * e = * value . clone ( ) } } } }
Replace property accesses to known values.
Replace property accesses to known values .
&mut self
e
&mut Expr
&mut self
e
&mut Expr