mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Construct a new JSRef in Root::r().
This commit is contained in:
parent
6077ed0ce8
commit
203d1669c8
1 changed files with 4 additions and 1 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue