avm2: Take Mutation instead of Activation in append

There is no need for a full on activation in append.
This commit is contained in:
sleepycatcoding 2023-10-23 22:33:23 +03:00 committed by Nathan Adams
parent 9d7f0a2bcc
commit 34b80a41b5
1 changed files with 4 additions and 4 deletions

View File

@ -160,8 +160,8 @@ impl<'gc> XmlListObject<'gc> {
} }
// ECMA-357 9.2.1.6 [[Append]] (V) // ECMA-357 9.2.1.6 [[Append]] (V)
pub fn append(&self, value: Value<'gc>, activation: &mut Activation<'_, 'gc>) { pub fn append(&self, value: Value<'gc>, mc: &Mutation<'gc>) {
let mut write = self.0.write(activation.gc()); let mut write = self.0.write(mc);
// 3. If Type(V) is XMLList, // 3. If Type(V) is XMLList,
if let Some(list) = value.as_object().and_then(|x| x.as_xml_list_object()) { if let Some(list) = value.as_object().and_then(|x| x.as_xml_list_object()) {
@ -750,7 +750,7 @@ impl<'gc> TObject<'gc> for XmlListObject<'gc> {
} }
// 2.c.ix. Call the [[Append]] method of x with argument y // 2.c.ix. Call the [[Append]] method of x with argument y
self.append(XmlObject::new(y, activation).into(), activation); self.append(XmlObject::new(y, activation).into(), activation.gc());
} }
// 2.d. If (Type(V) ∉ {XML, XMLList}) or (V.[[Class]] ∈ {"text", "attribute"}), let V = ToString(V) // 2.d. If (Type(V) ∉ {XML, XMLList}) or (V.[[Class]] ∈ {"text", "attribute"}), let V = ToString(V)
@ -941,7 +941,7 @@ impl<'gc> TObject<'gc> for XmlListObject<'gc> {
} }
// 3.a.iii. Call the [[Append]] method of x with argument r // 3.a.iii. Call the [[Append]] method of x with argument r
self.append(r.as_object().into(), activation); self.append(r.as_object().into(), activation.gc());
} }
let mut write = self.0.write(activation.gc()); let mut write = self.0.write(activation.gc());