avm2: Support any name in XML get_property_local

Fixes #9999
This commit is contained in:
Tom Schuster 2023-03-12 17:38:10 +01:00 committed by Aaron Hill
parent 2d9c1a3829
commit 3d29b81a8c
2 changed files with 32 additions and 29 deletions

View File

@ -294,7 +294,11 @@ impl<'gc> E4XNode<'gc> {
}
pub fn matches_name(&self, name: &Multiname<'gc>) -> bool {
// FIXME - we need to handle namespaces heere
// FIXME - we need to handle namespaces here
if name.is_any_name() {
return true;
}
if let Some(local_name) = self.local_name() {
Some(local_name) == name.local_name()
} else {

View File

@ -118,6 +118,7 @@ impl<'gc> TObject<'gc> for XmlObject<'gc> {
return Ok(Value::Undefined);
}
}
}
let matched_children = if let E4XNodeKind::Element {
children,
@ -143,10 +144,8 @@ impl<'gc> TObject<'gc> for XmlObject<'gc> {
} else {
Vec::new()
};
return Ok(
XmlListObject::new(activation, matched_children, Some(self.into())).into(),
);
}
return Ok(XmlListObject::new(activation, matched_children, Some(self.into())).into());
}
read.base.get_property_local(name, activation)