script: add CanGc argument to Promise::new_resolved and Promise::new_rejected (#35605)

* add CanGc to new_resolved and use it where possible

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* add CanGc to new_rejected

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
This commit is contained in:
Gae24 2025-02-23 05:45:47 +01:00 committed by GitHub
parent dd13342f18
commit adb831eefe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 23 additions and 29 deletions

View file

@ -371,7 +371,7 @@ impl ReadableStreamDefaultReaderMethods<crate::DomTypeHolder> for ReadableStream
&self.global(),
error.handle_mut(),
);
return Promise::new_rejected(&self.global(), cx, error.handle());
return Promise::new_rejected(&self.global(), cx, error.handle(), can_gc);
}
// Let promise be a new promise.
let promise = Promise::new(&self.global(), can_gc);