From 34b80a41b53224695f693149809d2c7b2099679d Mon Sep 17 00:00:00 2001 From: sleepycatcoding <131554884+sleepycatcoding@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:33:23 +0300 Subject: [PATCH] avm2: Take Mutation instead of Activation in append There is no need for a full on activation in append. --- core/src/avm2/object/xml_list_object.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/avm2/object/xml_list_object.rs b/core/src/avm2/object/xml_list_object.rs index da159047a..cc50df40c 100644 --- a/core/src/avm2/object/xml_list_object.rs +++ b/core/src/avm2/object/xml_list_object.rs @@ -160,8 +160,8 @@ impl<'gc> XmlListObject<'gc> { } // ECMA-357 9.2.1.6 [[Append]] (V) - pub fn append(&self, value: Value<'gc>, activation: &mut Activation<'_, 'gc>) { - let mut write = self.0.write(activation.gc()); + pub fn append(&self, value: Value<'gc>, mc: &Mutation<'gc>) { + let mut write = self.0.write(mc); // 3. If Type(V) is XMLList, 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 - 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) @@ -941,7 +941,7 @@ impl<'gc> TObject<'gc> for XmlListObject<'gc> { } // 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());