mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
refactor: add CanGc as argument to Promise::reject_error (#35646)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
parent
c844ed232a
commit
38b71087bd
43 changed files with 323 additions and 249 deletions
|
@ -718,7 +718,10 @@ impl WritableStream {
|
|||
if self.is_closed() || self.is_errored() {
|
||||
// return a promise rejected with a TypeError exception.
|
||||
let promise = Promise::new(global, can_gc);
|
||||
promise.reject_error(Error::Type("Stream is closed or errored.".to_string()));
|
||||
promise.reject_error(
|
||||
Error::Type("Stream is closed or errored.".to_string()),
|
||||
can_gc,
|
||||
);
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
@ -913,7 +916,7 @@ impl WritableStreamMethods<crate::DomTypeHolder> for WritableStream {
|
|||
if self.is_locked() {
|
||||
// return a promise rejected with a TypeError exception.
|
||||
let promise = Promise::new(&global, can_gc);
|
||||
promise.reject_error(Error::Type("Stream is locked.".to_string()));
|
||||
promise.reject_error(Error::Type("Stream is locked.".to_string()), can_gc);
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
@ -930,7 +933,7 @@ impl WritableStreamMethods<crate::DomTypeHolder> for WritableStream {
|
|||
if self.is_locked() {
|
||||
// return a promise rejected with a TypeError exception.
|
||||
let promise = Promise::new(&global, can_gc);
|
||||
promise.reject_error(Error::Type("Stream is locked.".to_string()));
|
||||
promise.reject_error(Error::Type("Stream is locked.".to_string()), can_gc);
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
@ -938,9 +941,10 @@ impl WritableStreamMethods<crate::DomTypeHolder> for WritableStream {
|
|||
if self.close_queued_or_in_flight() {
|
||||
// return a promise rejected with a TypeError exception.
|
||||
let promise = Promise::new(&global, can_gc);
|
||||
promise.reject_error(Error::Type(
|
||||
"Stream has closed queued or in-flight".to_string(),
|
||||
));
|
||||
promise.reject_error(
|
||||
Error::Type("Stream has closed queued or in-flight".to_string()),
|
||||
can_gc,
|
||||
);
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue