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

@ -836,14 +836,14 @@ impl XRSessionMethods<crate::DomTypeHolder> for XRSession {
if !self.is_immersive() &&
(ty == XRReferenceSpaceType::Bounded_floor || ty == XRReferenceSpaceType::Unbounded)
{
p.reject_error(Error::NotSupported);
p.reject_error(Error::NotSupported, can_gc);
return p;
}
match ty {
XRReferenceSpaceType::Unbounded => {
// XXXmsub2 figure out how to support this
p.reject_error(Error::NotSupported)
p.reject_error(Error::NotSupported, can_gc)
},
ty => {
if ty != XRReferenceSpaceType::Viewer &&
@ -857,7 +857,7 @@ impl XRSessionMethods<crate::DomTypeHolder> for XRSession {
.iter()
.any(|f| *f == s)
{
p.reject_error(Error::NotSupported);
p.reject_error(Error::NotSupported, can_gc);
return p;
}
}
@ -927,7 +927,7 @@ impl XRSessionMethods<crate::DomTypeHolder> for XRSession {
.iter()
.any(|f| f == "hit-test")
{
p.reject_error(Error::NotSupported);
p.reject_error(Error::NotSupported, can_gc);
return p;
}
@ -1035,12 +1035,15 @@ impl XRSessionMethods<crate::DomTypeHolder> for XRSession {
supported_frame_rates.is_empty() ||
self.ended.get()
{
promise.reject_error(Error::InvalidState);
promise.reject_error(Error::InvalidState, can_gc);
return promise;
}
if !supported_frame_rates.contains(&*rate) {
promise.reject_error(Error::Type("Provided framerate not supported".into()));
promise.reject_error(
Error::Type("Provided framerate not supported".into()),
can_gc,
);
return promise;
}
}