From 33dde1eccfba187d1401fc7b4175b55d915a3b1e Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Sat, 28 Oct 2023 14:33:56 +0200 Subject: [PATCH] avm2: Ignore a missing [[TargetProperty]] when assigning an XMLList --- core/src/avm2/object/xml_list_object.rs | 17 ++++++++--------- .../e4x/XML/e13_4_4_3/v10/test.toml | 1 - 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core/src/avm2/object/xml_list_object.rs b/core/src/avm2/object/xml_list_object.rs index 0ca9e124f378..0236150fa873 100644 --- a/core/src/avm2/object/xml_list_object.rs +++ b/core/src/avm2/object/xml_list_object.rs @@ -743,15 +743,14 @@ impl<'gc> TObject<'gc> for XmlListObject<'gc> { if let Some(list) = value.as_object().and_then(|x| x.as_xml_list_object()) { - // FIXME: What if XMLList does not have a target property. - let target_property = - list.target_property().expect("Not validated yet"); - - if let Some(name) = target_property.local_name() { - y.set_local_name(name, activation.gc()); - } - if let Some(namespace) = target_property.explict_namespace() { - y.set_namespace(namespace, activation.gc()); + // Note: Don't set anything when there is no [[TargetProperty]]. + if let Some(target_property) = list.target_property() { + if let Some(name) = target_property.local_name() { + y.set_local_name(name, activation.gc()); + } + if let Some(namespace) = target_property.explict_namespace() { + y.set_namespace(namespace, activation.gc()); + } } } } diff --git a/tests/tests/swfs/from_avmplus/e4x/XML/e13_4_4_3/v10/test.toml b/tests/tests/swfs/from_avmplus/e4x/XML/e13_4_4_3/v10/test.toml index 29f3cef79022..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/e4x/XML/e13_4_4_3/v10/test.toml +++ b/tests/tests/swfs/from_avmplus/e4x/XML/e13_4_4_3/v10/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true