diff options
author | Josh Matthews <josh@joshmatthews.net> | 2016-08-25 18:06:37 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2016-09-22 16:16:54 -0400 |
commit | ef501603bf8997e29f8d2d538b7755838236d6c8 (patch) | |
tree | 4b100271f7b4c1d80cf0fbc4576e970259f2f1b4 /components/script/dom/bindings/js.rs | |
parent | f89355b85d9cb8be5b576d6002bdf5227bd3c86a (diff) | |
download | servo-ef501603bf8997e29f8d2d538b7755838236d6c8.tar.gz servo-ef501603bf8997e29f8d2d538b7755838236d6c8.zip |
Ensure Promise "reflector" is not GCed before the Rust object.
Diffstat (limited to 'components/script/dom/bindings/js.rs')
-rw-r--r-- | components/script/dom/bindings/js.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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() + } } |