avm2: Implement call handler for XMLList
This delegates to the XMLList constructor, just as the XML call handler delegates to the XML constructor.
This commit is contained in:
parent
61f1cf88a5
commit
40318f905e
|
@ -1,5 +1,6 @@
|
|||
package {
|
||||
[Ruffle(InstanceAllocator)]
|
||||
[Ruffle(CallHandler)]
|
||||
public final dynamic class XMLList {
|
||||
|
||||
public function XMLList(value:* = undefined) {
|
||||
|
|
|
@ -56,6 +56,19 @@ pub fn init<'gc>(
|
|||
Ok(Value::Undefined)
|
||||
}
|
||||
|
||||
pub fn call_handler<'gc>(
|
||||
activation: &mut Activation<'_, 'gc>,
|
||||
_this: Option<Object<'gc>>,
|
||||
args: &[Value<'gc>],
|
||||
) -> Result<Value<'gc>, Error<'gc>> {
|
||||
Ok(activation
|
||||
.avm2()
|
||||
.classes()
|
||||
.xml_list
|
||||
.construct(activation, args)?
|
||||
.into())
|
||||
}
|
||||
|
||||
pub fn has_complex_content<'gc>(
|
||||
_activation: &mut Activation<'_, 'gc>,
|
||||
this: Option<Object<'gc>>,
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
trace("From complex string:")
|
||||
trace(complexXML.children().length());
|
||||
trace(complexXML.name());
|
||||
|
||||
trace("XMLList from string:");
|
||||
trace(XMLList("<p>First element</p><p>Second element</p>"));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,3 +4,6 @@ Some string
|
|||
From complex string:
|
||||
1
|
||||
outer
|
||||
XMLList from string:
|
||||
<p>First element</p>
|
||||
<p>Second element</p>
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue