Construct a new JSRef in Root::r().

This commit is contained in:
Ms2ger 2015-01-02 10:28:24 +01:00
parent 6077ed0ce8
commit 203d1669c8

View file

@ -514,7 +514,10 @@ impl<T: Reflectable> Root<T> {
/// Obtain a safe reference to the wrapped JS owned-value that cannot outlive
/// the lifetime of this root.
pub fn r<'b>(&'b self) -> JSRef<'b, T> {
self.jsref.clone()
JSRef {
ptr: self.jsref.ptr,
chain: ContravariantLifetime,
}
}
}