/// Deserialize an Object and any children from a JSON object
/// It would be best if this was implemented via serde but due to avm and context it can't
/// Undefined fields aren't deserialized
Deserialize an Object and any children from a JSON object
It would be best if this was implemented via serde but due to avm and context it can't
Undefined fields aren't deserialized
Deserialize an Object and any children from a JSON object It would be best if this was implemented via serde but due to avm and context it can ' t Undefined fields aren ' t deserialized
fn deserialize_object<'gc>(
    json_obj: json::object::Object,
    activation: &mut Activation<'_, 'gc, '_>,
) -> Value<'gc> {
    // Deserialize Object
    let obj_proto = activation.context.avm1.prototypes.object;
    if let Ok(obj) = obj_proto.create_bare_object(activation, obj_proto) {
        for entry in json_obj.iter() {
            let value = recursive_deserialize(entry.1.clone(), activation);
            obj.define_value(
                activation.context.gc_context,
                entry.0,
                value,
                Attribute::empty(),
            );
        }
        obj.into()
    } else {
        Value::Undefined
    }
}
fn deserialize_object < ' gc > ( json_obj : json :: object :: Object , activation : & mut Activation < ' _ , ' gc , ' _ > , ) -> Value < ' gc > { // Deserialize Object let obj_proto = activation . context . avm1 . prototypes . object ; if let Ok ( obj ) = obj_proto . create_bare_object ( activation , obj_proto ) { for entry in json_obj . iter ( ) { let value = recursive_deserialize ( entry . 1 . clone ( ) , activation ) ; obj . define_value ( activation . context . gc_context , entry . 0 , value , Attribute :: empty ( ) , ) ; } obj . into ( ) } else { Value :: Undefined } }
Deserialize an Object and any children from a JSON object
It would be best if this was implemented via serde but due to avm and context it can't
Undefined fields aren't deserialized
Deserialize an Object and any children from a JSON object It would be best if this was implemented via serde but due to avm and context it can ' t Undefined fields aren ' t deserialized
json_obj
json::object::Object
activation
&mut Activation<'_, 'gc, '_>