diff options
author | nxnfufunezn <nxnfufunezn@gmail.com> | 2015-10-31 17:41:00 +0530 |
---|---|---|
committer | nxnfufunezn <nxnfufunezn@gmail.com> | 2015-10-31 18:15:16 +0530 |
commit | d8ef3809a6c73922a5affc475f623a0f1152be28 (patch) | |
tree | 282199e1d9c244c20d62f35b7f6517913d2e37f0 /components/script/dom/bindings/js.rs | |
parent | 521a87180a85709f8f704df33537f79bd131bf71 (diff) | |
download | servo-d8ef3809a6c73922a5affc475f623a0f1152be28.tar.gz servo-d8ef3809a6c73922a5affc475f623a0f1152be28.zip |
Removed JS::root Fixes #8251
Diffstat (limited to 'components/script/dom/bindings/js.rs')
-rw-r--r-- | components/script/dom/bindings/js.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index a6af7680a96..c78399189ab 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -73,10 +73,6 @@ impl<T> JS<T> { } impl<T: Reflectable> JS<T> { - /// Root this JS-owned value to prevent its collection as garbage. - pub fn root(&self) -> Root<T> { - Root::new(self.ptr) - } /// Create a JS<T> from a Root<T> /// XXX Not a great API. Should be a call on Root<T> instead #[allow(unrooted_must_root)] @@ -291,7 +287,7 @@ impl<T: Reflectable> MutHeap<JS<T>> { pub fn get(&self) -> Root<T> { debug_assert!(task_state::get().is_script()); unsafe { - ptr::read(self.val.get()).root() + Root::from_ref(&*ptr::read(self.val.get())) } } } @@ -369,7 +365,7 @@ impl<T: Reflectable> MutNullableHeap<JS<T>> { pub fn get(&self) -> Option<Root<T>> { debug_assert!(task_state::get().is_script()); unsafe { - ptr::read(self.ptr.get()).map(|o| o.root()) + ptr::read(self.ptr.get()).map(|o| Root::from_ref(&*o)) } } |