Most XML properties return `null`, not `undefined`.
Furthermore, `prefix` does not distinguish between `<test>` and `<:test>` - they both have a `prefix` of `""`.
This commit is contained in:
parent
b491dd034e
commit
cfacd397cf
|
@ -54,7 +54,7 @@ pub fn create_xmlnode_proto<'gc>(
|
||||||
.as_xml_node()
|
.as_xml_node()
|
||||||
.and_then(|n| n.tag_name())
|
.and_then(|n| n.tag_name())
|
||||||
.map(|n| n.local_name().to_string().into())
|
.map(|n| n.local_name().to_string().into())
|
||||||
.unwrap_or_else(|| Value::Undefined.into()))
|
.unwrap_or_else(|| Value::Null.into()))
|
||||||
}),
|
}),
|
||||||
None,
|
None,
|
||||||
ReadOnly.into(),
|
ReadOnly.into(),
|
||||||
|
@ -67,7 +67,7 @@ pub fn create_xmlnode_proto<'gc>(
|
||||||
.as_xml_node()
|
.as_xml_node()
|
||||||
.and_then(|n| n.tag_name())
|
.and_then(|n| n.tag_name())
|
||||||
.map(|n| n.node_name().into())
|
.map(|n| n.node_name().into())
|
||||||
.unwrap_or_else(|| Value::Undefined.into()))
|
.unwrap_or_else(|| Value::Null.into()))
|
||||||
}),
|
}),
|
||||||
None,
|
None,
|
||||||
ReadOnly.into(),
|
ReadOnly.into(),
|
||||||
|
@ -93,7 +93,7 @@ pub fn create_xmlnode_proto<'gc>(
|
||||||
.as_xml_node()
|
.as_xml_node()
|
||||||
.and_then(|n| n.node_value())
|
.and_then(|n| n.node_value())
|
||||||
.map(|n| n.into())
|
.map(|n| n.into())
|
||||||
.unwrap_or_else(|| Value::Undefined.into()))
|
.unwrap_or_else(|| Value::Null.into()))
|
||||||
}),
|
}),
|
||||||
None,
|
None,
|
||||||
ReadOnly.into(),
|
ReadOnly.into(),
|
||||||
|
@ -105,8 +105,12 @@ pub fn create_xmlnode_proto<'gc>(
|
||||||
Ok(this
|
Ok(this
|
||||||
.as_xml_node()
|
.as_xml_node()
|
||||||
.and_then(|n| n.tag_name())
|
.and_then(|n| n.tag_name())
|
||||||
.and_then(|n| n.prefix().map(|n| n.to_string().into()))
|
.map(|n| {
|
||||||
.unwrap_or_else(|| Value::Undefined.into()))
|
n.prefix()
|
||||||
|
.map(|n| n.to_string().into())
|
||||||
|
.unwrap_or("".to_string().into())
|
||||||
|
})
|
||||||
|
.unwrap_or_else(|| Value::Null.into()))
|
||||||
}),
|
}),
|
||||||
None,
|
None,
|
||||||
ReadOnly.into(),
|
ReadOnly.into(),
|
||||||
|
|
Loading…
Reference in New Issue