mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Rename Promise::new to Promise::new_in_current_compartment
This commit is contained in:
parent
6fa1853bb1
commit
782b58587a
25 changed files with 93 additions and 51 deletions
|
@ -80,13 +80,11 @@ impl Drop for Promise {
|
|||
|
||||
impl Promise {
|
||||
#[allow(unsafe_code)]
|
||||
pub fn new(global: &GlobalScope) -> Rc<Promise> {
|
||||
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>());
|
||||
unsafe {
|
||||
Promise::create_js_promise(cx, HandleObject::null(), obj.handle_mut());
|
||||
Promise::new_with_js_promise(obj.handle(), cx)
|
||||
}
|
||||
Promise::create_js_promise(cx, HandleObject::null(), obj.handle_mut());
|
||||
Promise::new_with_js_promise(obj.handle(), cx)
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue