Auto merge of #8147 - nox:weakref, r=Ms2ger

Implement weak-referenceable JS-managed objects

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8147)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-11-13 06:22:40 +05:30
commit e63b1e83d4
10 changed files with 268 additions and 5 deletions

View file

@ -322,7 +322,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 {