Add unrooted_must_root lint for usages of JS<T> in let/for bindings

This commit is contained in:
Manish Goregaokar 2014-09-16 22:35:41 +05:30
parent 12dc54d238
commit bded5c3703
11 changed files with 55 additions and 15 deletions

View file

@ -310,8 +310,8 @@ impl Document {
}
pub fn new(window: &JSRef<Window>, url: Option<Url>, doctype: IsHTMLDocument, content_type: Option<DOMString>) -> Temporary<Document> {
let document = Document::new_inherited(window, url, doctype, content_type);
let document = reflect_dom_object(box document, &Window(*window),
let document = reflect_dom_object(box Document::new_inherited(window, url, doctype, content_type),
&Window(*window),
DocumentBinding::Wrap).root();
let node: &JSRef<Node> = NodeCast::from_ref(&*document);