servo: Merge #3374 - Add lint for ensuring proper rooting of JS<T>; r=jdm (from Manishearth:lint_unrooted_jsmanaged)

Source-Repo: https://github.com/servo/servo
Source-Revision: 11ba79894a13ddaee4bfcdd64d23fd4b54a041f3
This commit is contained in:
Manish Goregaokar
2014-09-17 17:47:19 +05:00
parent 5ba9439229
commit 1a1910fec1
131 changed files with 345 additions and 28 deletions

View File

@@ -19,6 +19,7 @@ use dom::nodelist::NodeList;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct DocumentFragment {
pub node: Node,
}
@@ -38,8 +39,8 @@ impl DocumentFragment {
}
pub fn new(document: &JSRef<Document>) -> Temporary<DocumentFragment> {
let node = DocumentFragment::new_inherited(document);
Node::reflect_node(box node, document, DocumentFragmentBinding::Wrap)
Node::reflect_node(box DocumentFragment::new_inherited(document),
document, DocumentFragmentBinding::Wrap)
}
pub fn Constructor(global: &GlobalRef) -> Fallible<Temporary<DocumentFragment>> {