Introduce trait WeakReferenceable

This allows to take weak references of JS-managed DOM objects.
This commit is contained in:
Anthony Ramine 2015-10-18 13:53:12 +02:00
parent 12f6ba29a7
commit 72c67efe96
10 changed files with 268 additions and 5 deletions

View file

@ -729,7 +729,8 @@ pub unsafe fn private_from_proto_check<F>(mut obj: *mut JSObject, proto_check: F
}
}
fn native_from_object<T>(obj: *mut JSObject) -> Result<*const T, ()>
/// Get a `*const T` for a DOM object accessible from a `JSObject`.
pub fn native_from_object<T>(obj: *mut JSObject) -> Result<*const T, ()>
where T: Reflectable + IDLInterface
{
unsafe {