aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/js.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2016-08-25 18:06:37 -0400
committerJosh Matthews <josh@joshmatthews.net>2016-09-22 16:16:54 -0400
commitef501603bf8997e29f8d2d538b7755838236d6c8 (patch)
tree4b100271f7b4c1d80cf0fbc4576e970259f2f1b4 /components/script/dom/bindings/js.rs
parentf89355b85d9cb8be5b576d6002bdf5227bd3c86a (diff)
downloadservo-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.rs6
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()
+ }
}