Ensure Promise "reflector" is not GCed before the Rust object.

This commit is contained in:
Josh Matthews 2016-08-25 18:06:37 -04:00
parent f89355b85d
commit ef501603bf
3 changed files with 65 additions and 10 deletions

View file

@ -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()
}
}