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

@ -233,7 +233,8 @@ class Descriptor(DescriptorProvider):
# them as having a concrete descendant.
self.concrete = (not self.interface.isCallback() and
not self.interface.isNamespace() and
not self.interface.getExtendedAttribute("Abstract"))
not self.interface.getExtendedAttribute("Abstract") and
not spiderMonkeyInterface)
self.hasUnforgeableMembers = (self.concrete and
any(MemberIsUnforgeable(m, self) for m in
self.interface.members))

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