mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Make Promise::new take a &GlobalScope
This commit is contained in:
parent
a8c05c6962
commit
ac5a4adf5f
5 changed files with 11 additions and 9 deletions
|
@ -691,11 +691,11 @@ impl TestBindingMethods for TestBinding {
|
|||
fn PromiseNativeHandler(&self,
|
||||
resolve: Option<Rc<SimpleCallback>>,
|
||||
reject: Option<Rc<SimpleCallback>>) -> Rc<Promise> {
|
||||
let global = self.global();
|
||||
let handler = PromiseNativeHandler::new(global.r().as_global_scope(),
|
||||
let global = self.global_scope();
|
||||
let handler = PromiseNativeHandler::new(&global,
|
||||
resolve.map(SimpleHandler::new),
|
||||
reject.map(SimpleHandler::new));
|
||||
let p = Promise::new(global.r());
|
||||
let p = Promise::new(&global);
|
||||
p.append_native_handler(&handler);
|
||||
return p;
|
||||
|
||||
|
@ -720,7 +720,7 @@ impl TestBindingMethods for TestBinding {
|
|||
|
||||
#[allow(unrooted_must_root)]
|
||||
fn PromiseAttribute(&self) -> Rc<Promise> {
|
||||
Promise::new(self.global().r())
|
||||
Promise::new(&self.global_scope())
|
||||
}
|
||||
|
||||
fn AcceptPromise(&self, _promise: &Promise) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue