Skip to content

Commit

Permalink
avm1, avm2: Convert Object to AVM values as well
Browse files Browse the repository at this point in the history
  • Loading branch information
kmeisthax committed Nov 29, 2023
1 parent 204bdbf commit 6d77fea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion core/src/avm1/flv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ pub trait FlvValueAvm1Ext<'gc> {
impl<'gc> FlvValueAvm1Ext<'gc> for FlvValue<'_> {
fn to_avm1_value(self, activation: &mut Activation<'_, 'gc>) -> Avm1Value<'gc> {
match self {
FlvValue::EcmaArray(values) => avm1_object_from_flv_variables(activation, values),
FlvValue::EcmaArray(vars) | FlvValue::Object(vars) => {
avm1_object_from_flv_variables(activation, vars)
}
FlvValue::StrictArray(values) => avm1_array_from_flv_values(activation, values),
FlvValue::String(string_data) | FlvValue::LongString(string_data) => {
AvmString::new_utf8_bytes(activation.context.gc_context, string_data).into()
Expand Down
4 changes: 3 additions & 1 deletion core/src/avm2/flv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ pub trait FlvValueAvm2Ext<'gc> {
impl<'gc> FlvValueAvm2Ext<'gc> for FlvValue<'_> {
fn to_avm2_value(self, activation: &mut Activation<'_, 'gc>) -> Avm2Value<'gc> {
match self {
FlvValue::EcmaArray(variables) => avm2_object_from_flv_variables(activation, variables),
FlvValue::Object(variables) | FlvValue::EcmaArray(variables) => {
avm2_object_from_flv_variables(activation, variables)
}
FlvValue::StrictArray(values) => avm2_array_from_flv_values(activation, values),
FlvValue::String(string_data) | FlvValue::LongString(string_data) => {
AvmString::new_utf8_bytes(activation.context.gc_context, string_data).into()
Expand Down

0 comments on commit 6d77fea

Please sign in to comment.