Cleanup some code.

This commit is contained in:
Ms2ger 2013-10-07 16:30:34 +02:00
parent d99e69e244
commit 388f685549
7 changed files with 59 additions and 84 deletions

View file

@ -22,9 +22,8 @@ impl Comment {
pub fn Constructor(owner: @mut Window, data: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
let s = null_str_as_empty(data);
unsafe {
let compartment = (*owner.page).js_info.get_ref().js_compartment;
Ok(Node::as_abstract_node(compartment.cx.ptr, @Comment::new(s)))
}
let cx = (*owner.page).js_info.get_ref().js_compartment.cx.ptr;
let comment = @Comment::new(s);
Ok(unsafe { Node::as_abstract_node(cx, comment) })
}
}