diff options
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/promise.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/dom/promise.rs b/components/script/dom/promise.rs index eade086640d..9ff4adfe397 100644 --- a/components/script/dom/promise.rs +++ b/components/script/dom/promise.rs @@ -80,6 +80,11 @@ impl Drop for Promise { impl Promise { #[allow(unsafe_code)] + pub fn new(global: &GlobalScope, _comp: &JSAutoCompartment) -> Rc<Promise> { + unsafe { Promise::new_in_current_compartment(global) } + } + + #[allow(unsafe_code)] pub unsafe fn new_in_current_compartment(global: &GlobalScope) -> Rc<Promise> { let cx = global.get_cx(); rooted!(in(cx) let mut obj = ptr::null_mut::<JSObject>()); |