mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 16:17:41 +00:00
LibWeb: Propogate OOM errors from readable_stream_reader_generic_cancel
This commit is contained in:
parent
f9d6a161e8
commit
db1be40b13
3 changed files with 4 additions and 4 deletions
|
@ -242,7 +242,7 @@ void readable_stream_add_read_request(ReadableStream& stream, ReadRequest const&
|
|||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#readable-stream-reader-generic-cancel
|
||||
JS::NonnullGCPtr<WebIDL::Promise> readable_stream_reader_generic_cancel(ReadableStreamGenericReaderMixin& reader, JS::Value reason)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> readable_stream_reader_generic_cancel(ReadableStreamGenericReaderMixin& reader, JS::Value reason)
|
||||
{
|
||||
// 1. Let stream be reader.[[stream]]
|
||||
auto stream = reader.stream();
|
||||
|
@ -251,7 +251,7 @@ JS::NonnullGCPtr<WebIDL::Promise> readable_stream_reader_generic_cancel(Readable
|
|||
VERIFY(stream);
|
||||
|
||||
// 3. Return ! ReadableStreamCancel(stream, reason)
|
||||
return MUST(readable_stream_cancel(*stream, reason));
|
||||
return TRY(readable_stream_cancel(*stream, reason));
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#readable-stream-reader-generic-initialize
|
||||
|
|
|
@ -33,7 +33,7 @@ void readable_stream_fulfill_read_request(ReadableStream&, JS::Value chunk, bool
|
|||
size_t readable_stream_get_num_read_requests(ReadableStream&);
|
||||
bool readable_stream_has_default_reader(ReadableStream&);
|
||||
|
||||
JS::NonnullGCPtr<WebIDL::Promise> readable_stream_reader_generic_cancel(ReadableStreamGenericReaderMixin&, JS::Value reason);
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> readable_stream_reader_generic_cancel(ReadableStreamGenericReaderMixin&, JS::Value reason);
|
||||
void readable_stream_reader_generic_initialize(ReadableStreamGenericReaderMixin&, ReadableStream&);
|
||||
WebIDL::ExceptionOr<void> readable_stream_reader_generic_release(ReadableStreamGenericReaderMixin&);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<JS::Promise>> ReadableStreamGenericReaderMi
|
|||
}
|
||||
|
||||
// 2. Return ! ReadableStreamReaderGenericCancel(this, reason).
|
||||
auto promise_capability = readable_stream_reader_generic_cancel(*this, reason);
|
||||
auto promise_capability = TRY(readable_stream_reader_generic_cancel(*this, reason));
|
||||
return JS::NonnullGCPtr { verify_cast<JS::Promise>(*promise_capability->promise().ptr()) };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue