Use Cell::as_unsafe_cell in Reflector::rootable.

This commit is contained in:
Ms2ger 2014-11-14 11:56:00 +01:00
parent 85a2f0b66a
commit c0016c7438

View file

@ -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`.