Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions core/src/avm2/activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
{
let string_callee = istr!(self, "callee");

args_object
.set_string_property_local(string_callee, callee, self)
.unwrap();
args_object.set_dynamic_property(string_callee, callee, self.gc());
args_object.set_local_property_is_enumerable(self.gc(), string_callee, false);
}

Expand Down Expand Up @@ -1811,7 +1809,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
let value = self.pop_stack();
let name = self.pop_stack();

object.set_string_property_local(name.coerce_to_string(self)?, value, self)?;
object.set_dynamic_property(name.coerce_to_string(self)?, value, self.gc());
}

self.push_stack(object);
Expand Down
27 changes: 18 additions & 9 deletions core/src/avm2/amf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,20 @@ pub fn deserialize_value_impl<'gc>(

// Now let's add each element as a property
for element in elements {
array.set_string_property_local(
AvmString::new_utf8(activation.gc(), element.name()),
deserialize_value_impl(activation, element.value(), object_map)?,
activation,
)?;
let name = ruffle_wstr::from_utf8(element.name());
let value = deserialize_value_impl(activation, element.value(), object_map)?;

// If the name of the element was a valid array index, we set an
// element on the array instead of setting a dynamic property.
if let Some(index) = ArrayObject::as_array_index(&name) {
array.set_element(activation.gc(), index, value);
} else {
array.set_dynamic_property(
AvmString::new(activation.gc(), name),
value,
activation.gc(),
);
}
}
array.into()
}
Expand Down Expand Up @@ -462,7 +471,7 @@ pub fn deserialize_value_impl<'gc>(
dict_obj.set_property_by_object(key, value, activation.gc());
} else {
let key_string = key.coerce_to_string(activation)?;
dict_obj.set_string_property_local(key_string, value, activation)?;
dict_obj.set_dynamic_property(key_string, value, activation.gc());
}
}
dict_obj.into()
Expand Down Expand Up @@ -499,11 +508,11 @@ pub fn deserialize_lso<'gc>(
let obj = ScriptObject::new_object(activation);

for child in &lso.body {
obj.set_string_property_local(
obj.set_dynamic_property(
AvmString::new_utf8(activation.gc(), &child.name),
deserialize_value(activation, child.value())?,
activation,
)?;
activation.gc(),
);
}

Ok(obj)
Expand Down
12 changes: 5 additions & 7 deletions core/src/avm2/flv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ fn avm2_object_from_flv_variables<'gc>(
for value in variables {
let property_name = value.name;

info_object
.set_string_property_local(
AvmString::new_utf8_bytes(activation.gc(), property_name),
value.data.to_avm2_value(activation),
activation,
)
.expect("valid set");
info_object.set_dynamic_property(
AvmString::new_utf8_bytes(activation.gc(), property_name),
value.data.to_avm2_value(activation),
activation.gc(),
);
}

info_object.into()
Expand Down
Loading