Clean up the functions to retrieve a global root from JS objects

This commit is contained in:
Anthony Ramine 2016-05-21 16:30:12 +02:00
parent e179cb02ff
commit 34858fd0c9
2 changed files with 23 additions and 28 deletions

View file

@ -164,7 +164,7 @@ impl CallSetup {
/// Performs the setup needed to make a call.
#[allow(unrooted_must_root)]
pub fn new<T: CallbackContainer>(callback: &T, handling: ExceptionHandling) -> CallSetup {
let global = global_root_from_object(callback.callback());
let global = unsafe { global_root_from_object(callback.callback()) };
let cx = global.r().get_cx();
let exception_compartment = unsafe {