/// Initialize a property by Multiname lookup.
///
/// This method should not be overridden.
///
/// This corresponds directly with the AVM2 operation `initproperty`.
Initialize a property by Multiname lookup.
This method should not be overridden.

This corresponds directly with the AVM2 operation `initproperty`.
Initialize a property by Multiname lookup . This method should not be overridden . This corresponds directly with the AVM2 operation ` initproperty ` .
fn init_property(
        &mut self,
        multiname: &Multiname<'gc>,
        value: Value<'gc>,
        activation: &mut Activation<'_, 'gc, '_>,
    ) -> Result<(), Error> {
        match self.vtable().and_then(|vtable| vtable.get_trait(multiname)) {
            Some(Property::Slot { slot_id }) | Some(Property::ConstSlot { slot_id }) => self
                .base_mut(activation.context.gc_context)
                .set_slot(slot_id, value, activation.context.gc_context),
            Some(Property::Method { .. }) => Err("Cannot assign to a method".into()),
            Some(Property::Virtual { set: Some(set), .. }) => {
                self.call_method(set, &[value], activation).map(|_| ())
            }
            Some(Property::Virtual { set: None, .. }) => {
                Err("Illegal write to read-only property".into())
            }
            None => self.init_property_local(multiname, value, activation),
        }
    }
fn init_property ( & mut self , multiname : & Multiname < ' gc > , value : Value < ' gc > , activation : & mut Activation < ' _ , ' gc , ' _ > , ) -> Result < ( ) , Error > { match self . vtable ( ) . and_then ( | vtable | vtable . get_trait ( multiname ) ) { Some ( Property :: Slot { slot_id } ) | Some ( Property :: ConstSlot { slot_id } ) => self . base_mut ( activation . context . gc_context ) . set_slot ( slot_id , value , activation . context . gc_context ) , Some ( Property :: Method { .. } ) => Err ( " " . into ( ) ) , Some ( Property :: Virtual { set : Some ( set ) , .. } ) => { self . call_method ( set , & [ value ] , activation ) . map ( | _ | ( ) ) } Some ( Property :: Virtual { set : None , .. } ) => { Err ( " " . into ( ) ) } None => self . init_property_local ( multiname , value , activation ) , } }
Initialize a property by Multiname lookup.
Initialize a property by Multiname lookup .
&mut self
multiname
&Multiname<'gc>
value
Value<'gc>
activation
&mut Activation<'_, 'gc, '_>