refactor: add CanGc as argument to Promise::reject_error (#35646)

Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
Yerkebulan Tulibergenov 2025-02-25 02:12:58 -08:00 committed by GitHub
parent c844ed232a
commit 38b71087bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 323 additions and 249 deletions

View file

@ -1220,7 +1220,7 @@ impl HTMLMediaElement {
for promise in &*promises {
match result {
Ok(ref value) => promise.resolve_native(value, CanGc::note()),
Err(ref error) => promise.reject_error(error.clone()),
Err(ref error) => promise.reject_error(error.clone(), CanGc::note()),
}
}
}
@ -2195,7 +2195,7 @@ impl HTMLMediaElementMethods<crate::DomTypeHolder> for HTMLMediaElement {
.get()
.is_some_and(|e| e.Code() == MEDIA_ERR_SRC_NOT_SUPPORTED)
{
promise.reject_error(Error::NotSupported);
promise.reject_error(Error::NotSupported, can_gc);
return promise;
}