refactor: add CanGc as argument to Promise::resolve (#35616)

Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
Yerkebulan Tulibergenov 2025-02-23 04:12:21 -08:00 committed by GitHub
parent adb831eefe
commit 0383ba9a5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 330 additions and 294 deletions

View file

@ -69,9 +69,9 @@ impl FontFaceSet {
}
}
pub(crate) fn fulfill_ready_promise_if_needed(&self) {
pub(crate) fn fulfill_ready_promise_if_needed(&self, can_gc: CanGc) {
if !self.promise.is_fulfilled() {
self.promise.resolve_native(self);
self.promise.resolve_native(self, can_gc);
}
}
}
@ -114,7 +114,7 @@ impl FontFaceSetMethods<crate::DomTypeHolder> for FontFaceSet {
// TODO: Step 4.2. Resolve promise with the result of waiting for all of the
// [[FontStatusPromise]]s of each font face in the font face list, in order.
let matched_fonts = Vec::<&FontFace>::new();
promise.resolve_native(&matched_fonts);
promise.resolve_native(&matched_fonts, CanGc::note());
}));
// Step 2. Return promise. Complete the rest of these steps asynchronously.