Implement Document.createComment.

This commit is contained in:
Ms2ger 2013-10-10 22:50:41 +02:00
parent 368d512b99
commit 98cdf5c118
4 changed files with 19 additions and 4 deletions

View file

@ -106,6 +106,14 @@ pub fn null_str_as_empty_ref<'a>(s: &'a DOMString) -> &'a str {
}
}
pub fn null_str_as_word_null(s: &DOMString) -> ~str {
// We don't use map_default because it would allocate ~"null" even for Some.
match *s {
Some(ref s) => s.clone(),
None => ~"null"
}
}
fn is_dom_class(clasp: *JSClass) -> bool {
unsafe {
((*clasp).flags & js::JSCLASS_IS_DOMJSCLASS) != 0