mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +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
|
@ -1009,6 +1009,7 @@ impl TestBindingMethods for TestBinding {
|
|||
);
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn PromiseNativeHandler(
|
||||
&self,
|
||||
resolve: Option<Rc<SimpleCallback>>,
|
||||
|
@ -1020,7 +1021,7 @@ impl TestBindingMethods for TestBinding {
|
|||
resolve.map(SimpleHandler::new),
|
||||
reject.map(SimpleHandler::new),
|
||||
);
|
||||
let p = Promise::new(&global);
|
||||
let p = unsafe { Promise::new_in_current_compartment(&global) };
|
||||
p.append_native_handler(&handler);
|
||||
return p;
|
||||
|
||||
|
@ -1043,8 +1044,9 @@ impl TestBindingMethods for TestBinding {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn PromiseAttribute(&self) -> Rc<Promise> {
|
||||
Promise::new(&self.global())
|
||||
unsafe { Promise::new_in_current_compartment(&self.global()) }
|
||||
}
|
||||
|
||||
fn AcceptPromise(&self, _promise: &Promise) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue