avm2: Preserve attribute flag when filling lazy multiname with QName

Fixes #12570
This commit is contained in:
sleepycatcoding 2023-08-27 23:06:46 +03:00 committed by Aaron Hill
parent 879dac347c
commit 33164d3f56
5 changed files with 27 additions and 2 deletions

View File

@ -253,8 +253,13 @@ impl<'gc> Multiname<'gc> {
if self.has_lazy_ns() { if self.has_lazy_ns() {
let _ = activation.pop_stack(); // ignore the ns component let _ = activation.pop_stack(); // ignore the ns component
} }
let name = qname_object.name(); let mut name = qname_object.name().clone();
return Ok(name.clone());
if self.is_attribute() {
name.set_is_attribute(true);
}
return Ok(name);
} }
Some(name_value.coerce_to_string(activation)?) Some(name_value.coerce_to_string(activation)?)

View File

@ -0,0 +1,18 @@
package
{
import flash.display.Sprite;
public class Test extends Sprite
{
}
}
var xml =
<alpha>
<bravo attr1="value1" attr2="wrong">
<charlie attr1="value2" attr2="wrong"/>
</bravo>
</alpha>;
var q = new QName("attr1");
trace("xml..@[q]: " + xml..@[q]);

View File

@ -0,0 +1 @@
xml..@[q]: value1value2

View File

@ -0,0 +1 @@
num_ticks = 1