From 203d1669c8ce98468c7935ead8f0ef4c803dd5a0 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 2 Jan 2015 10:28:24 +0100 Subject: [PATCH] Construct a new JSRef in Root::r(). --- components/script/dom/bindings/js.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 3eb911e7be3..f7208237cc1 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -514,7 +514,10 @@ impl Root { /// 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, + } } }