Turn on GC all the time. Fix rooting errors during parsing and storing timers. Fix borrow errors during tracing.

This commit is contained in:
Josh Matthews 2014-03-28 10:17:56 -04:00
parent 4051a8096d
commit ffdc3f5b32
109 changed files with 1567 additions and 996 deletions

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::InheritTypes::CommentDerived;
use dom::bindings::codegen::BindingDeclarations::CommentBinding;
use dom::bindings::js::JS;
use dom::bindings::js::{JS, JSRef, RootCollection};
use dom::bindings::error::Fallible;
use dom::characterdata::CharacterData;
use dom::document::Document;
@ -35,12 +35,16 @@ impl Comment {
}
}
pub fn new(text: DOMString, document: &JS<Document>) -> JS<Comment> {
let node = Comment::new_inherited(text, document.clone());
pub fn new(text: DOMString, document: &JSRef<Document>) -> JS<Comment> {
let node = Comment::new_inherited(text, document.unrooted());
Node::reflect_node(~node, document, CommentBinding::Wrap)
}
pub fn Constructor(owner: &JS<Window>, data: DOMString) -> Fallible<JS<Comment>> {
Ok(Comment::new(data, &owner.get().Document()))
pub fn Constructor(owner: &JSRef<Window>, data: DOMString) -> Fallible<JS<Comment>> {
let roots = RootCollection::new();
let document = owner.get().Document();
let document = document.root(&roots);
Ok(Comment::new(data, &document.root_ref()))
}
}