mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Mark promise creation methods with CanGc (#33928)
* Add CanGc annotations to promise constructor. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc arguments for Promise::new_in_current_realm. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix out-of-order entries. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from Promise::new. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Suppress clippy warning. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
edc304854f
commit
575e885529
50 changed files with 422 additions and 221 deletions
|
@ -1013,6 +1013,7 @@ impl TestBindingMethods for TestBinding {
|
|||
resolve: Option<Rc<SimpleCallback>>,
|
||||
reject: Option<Rc<SimpleCallback>>,
|
||||
comp: InRealm,
|
||||
can_gc: CanGc,
|
||||
) -> Rc<Promise> {
|
||||
let global = self.global();
|
||||
let handler = PromiseNativeHandler::new(
|
||||
|
@ -1020,8 +1021,8 @@ impl TestBindingMethods for TestBinding {
|
|||
resolve.map(SimpleHandler::new_boxed),
|
||||
reject.map(SimpleHandler::new_boxed),
|
||||
);
|
||||
let p = Promise::new_in_current_realm(comp);
|
||||
p.append_native_handler(&handler, comp);
|
||||
let p = Promise::new_in_current_realm(comp, can_gc);
|
||||
p.append_native_handler(&handler, comp, can_gc);
|
||||
return p;
|
||||
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
|
@ -1042,8 +1043,8 @@ impl TestBindingMethods for TestBinding {
|
|||
}
|
||||
}
|
||||
|
||||
fn PromiseAttribute(&self, comp: InRealm) -> Rc<Promise> {
|
||||
Promise::new_in_current_realm(comp)
|
||||
fn PromiseAttribute(&self, comp: InRealm, can_gc: CanGc) -> Rc<Promise> {
|
||||
Promise::new_in_current_realm(comp, can_gc)
|
||||
}
|
||||
|
||||
fn AcceptPromise(&self, _promise: &Promise) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue