mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
require entered realm, use aes, to append native promise handler
This commit is contained in:
parent
bd5796c90b
commit
48d4aec5b6
4 changed files with 29 additions and 26 deletions
|
@ -321,13 +321,13 @@ impl ModuleTree {
|
|||
))),
|
||||
);
|
||||
|
||||
let _realm = enter_realm(&*owner.global());
|
||||
AlreadyInRealm::assert(&*owner.global());
|
||||
let _ais = AutoIncumbentScript::new(&*owner.global());
|
||||
let global = owner.global();
|
||||
let realm = enter_realm(&*global);
|
||||
let comp = InRealm::Entered(&realm);
|
||||
|
||||
let promise = promise.as_ref().unwrap();
|
||||
|
||||
promise.append_native_handler(&handler);
|
||||
promise.append_native_handler(&handler, comp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -723,13 +723,13 @@ impl ModuleOwner {
|
|||
))),
|
||||
);
|
||||
|
||||
let realm = enter_realm(&*self.global());
|
||||
let global = self.global();
|
||||
let realm = enter_realm(&*global);
|
||||
let comp = InRealm::Entered(&realm);
|
||||
let _ais = AutoIncumbentScript::new(&*self.global());
|
||||
|
||||
let promise = Promise::new_in_current_realm(&self.global(), comp);
|
||||
|
||||
promise.append_native_handler(&handler);
|
||||
promise.append_native_handler(&handler, comp);
|
||||
|
||||
promise
|
||||
}
|
||||
|
@ -1362,8 +1362,7 @@ fn fetch_module_descendants_and_link(
|
|||
unsafe {
|
||||
let global = owner.global();
|
||||
|
||||
let _realm = enter_realm(&*global);
|
||||
AlreadyInRealm::assert(&*global);
|
||||
let realm = enter_realm(&*global);
|
||||
let _ais = AutoIncumbentScript::new(&*global);
|
||||
|
||||
let abv = RootedObjectVectorWrapper::new(*global.get_cx());
|
||||
|
@ -1402,7 +1401,8 @@ fn fetch_module_descendants_and_link(
|
|||
))),
|
||||
);
|
||||
|
||||
promise_all.append_native_handler(&handler);
|
||||
let comp = InRealm::Entered(&realm);
|
||||
promise_all.append_native_handler(&handler, comp);
|
||||
|
||||
return Some(promise_all);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue