/// Init a property by its QName.
Init a property by its QName.
Init a property by its QName .
fn init_property(
        &mut self,
        receiver: Object<'gc>,
        name: &QName<'gc>,
        value: Value<'gc>,
        activation: &mut Activation<'_, 'gc, '_>,
    ) -> Result<(), Error> {
        if !self.has_instantiated_property(name) {
            for abc_trait in self.get_trait(name)? {
                self.install_trait(activation, abc_trait, receiver)?;
            }
        }
        if self.has_own_virtual_setter(name) {
            return self.init_property_local(receiver, name, value, activation);
        }
        let mut proto = self.proto();
        while let Some(mut my_proto) = proto {
            //NOTE: This only works because we validate ahead-of-time that
            //we're calling a virtual setter. If you call `set_property` on
            //a non-virtual you will actually alter the prototype.
            if my_proto.has_own_virtual_setter(name) {
                return my_proto.init_property(receiver, name, value, activation);
            }
            proto = my_proto.proto();
        }
        receiver.init_property_local(receiver, name, value, activation)
    }
fn init_property ( & mut self , receiver : Object < ' gc > , name : & QName < ' gc > , value : Value < ' gc > , activation : & mut Activation < ' _ , ' gc , ' _ > , ) -> Result < ( ) , Error > { if ! self . has_instantiated_property ( name ) { for abc_trait in self . get_trait ( name ) ? { self . install_trait ( activation , abc_trait , receiver ) ? ; } } if self . has_own_virtual_setter ( name ) { return self . init_property_local ( receiver , name , value , activation ) ; } let mut proto = self . proto ( ) ; while let Some ( mut my_proto ) = proto { //NOTE: This only works because we validate ahead-of-time that //we're calling a virtual setter. If you call `set_property` on //a non-virtual you will actually alter the prototype. if my_proto . has_own_virtual_setter ( name ) { return my_proto . init_property ( receiver , name , value , activation ) ; } proto = my_proto . proto ( ) ; } receiver . init_property_local ( receiver , name , value , activation ) }
Init a property by its QName.
Init a property by its QName .
&mut self
receiver
Object<'gc>
name
&QName<'gc>
value
Value<'gc>
activation
&mut Activation<'_, 'gc, '_>