From ef501603bf8997e29f8d2d538b7755838236d6c8 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 25 Aug 2016 18:06:37 -0400 Subject: Ensure Promise "reflector" is not GCed before the Rust object. --- components/script/dom/bindings/js.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'components/script/dom/bindings/js.rs') diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 50cae7e1f04..1fd127b3b28 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -270,6 +270,12 @@ impl MutHeapJSVal { debug_assert!(thread_state::get().is_script()); unsafe { (*self.val.get()).get() } } + + /// Get the underlying unsafe pointer to the contained value. + pub unsafe fn get_unsafe(&self) -> *mut JSVal { + debug_assert!(thread_state::get().is_script()); + (*self.val.get()).get_unsafe() + } } -- cgit v1.2.3