aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-11-14 11:56:00 +0100
committerMs2ger <ms2ger@gmail.com>2014-11-14 11:56:00 +0100
commitc0016c74386bc2af6beb2091bcf3c3d3953f2119 (patch)
treeb4f9328594921f86e715cd24b30592de972a0784 /components/script/dom
parent85a2f0b66a32cfd6022b3e6cec6ec06f3b59baf1 (diff)
downloadservo-c0016c74386bc2af6beb2091bcf3c3d3953f2119.tar.gz
servo-c0016c74386bc2af6beb2091bcf3c3d3953f2119.zip
Use Cell::as_unsafe_cell in Reflector::rootable.
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/bindings/utils.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs
index 3117fc10f45..ad85597fd07 100644
--- a/components/script/dom/bindings/utils.rs
+++ b/components/script/dom/bindings/utils.rs
@@ -469,13 +469,11 @@ impl Reflector {
self.object.set(object);
}
- /// Return a pointer to the memory location at which the JS reflector object is stored.
- /// Used by Temporary values to root the reflector, as required by the JSAPI rooting
- /// APIs.
- pub fn rootable(&self) -> *mut *mut JSObject {
- &self.object as *const Cell<*mut JSObject>
- as *mut Cell<*mut JSObject>
- as *mut *mut JSObject
+ /// Return a pointer to the memory location at which the JS reflector
+ /// object is stored. Used by Temporary values to root the reflector, as
+ /// required by the JSAPI rooting APIs.
+ pub unsafe fn rootable(&self) -> *mut *mut JSObject {
+ self.object.as_unsafe_cell().get()
}
/// Create an uninitialized `Reflector`.