Fix double-panic when the script task panics.

This commit is contained in:
Josh Matthews 2015-03-11 13:49:42 -04:00 committed by Ms2ger
parent b1a35f549b
commit 48b151948f
3 changed files with 18 additions and 12 deletions

View file

@ -91,6 +91,12 @@ impl<T: Reflectable> Unrooted<T> {
}
}
/// Create a new unrooted value from a `Temporary<T>`.
#[allow(unrooted_must_root)]
pub fn from_temporary(ptr: Temporary<T>) -> Unrooted<T> {
Unrooted::from_js(ptr.inner)
}
/// Get the `Reflector` for this pointer.
pub fn reflector<'a>(&'a self) -> &'a Reflector {
unsafe {