mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Add a 'get a reader' helper method on ReadableStream
This commit is contained in:
parent
da408cb09a
commit
9ce0c5914b
Notes:
github-actions[bot]
2024-12-25 11:03:14 +00:00
Author: https://github.com/shannonbooth
Commit: 9ce0c5914b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3029
Reviewed-by: https://github.com/kennethmyhra ✅
5 changed files with 14 additions and 6 deletions
|
@ -376,7 +376,7 @@ GC::Ref<WebIDL::Promise> Blob::text()
|
|||
auto stream = get_stream();
|
||||
|
||||
// 2. Let reader be the result of getting a reader from stream. If that threw an exception, return a new promise rejected with that exception.
|
||||
auto reader_or_exception = acquire_readable_stream_default_reader(*stream);
|
||||
auto reader_or_exception = stream->get_a_reader();
|
||||
if (reader_or_exception.is_exception())
|
||||
return WebIDL::create_rejected_promise_from_exception(realm, reader_or_exception.release_error());
|
||||
auto reader = reader_or_exception.release_value();
|
||||
|
@ -405,7 +405,7 @@ GC::Ref<WebIDL::Promise> Blob::array_buffer()
|
|||
auto stream = get_stream();
|
||||
|
||||
// 2. Let reader be the result of getting a reader from stream. If that threw an exception, return a new promise rejected with that exception.
|
||||
auto reader_or_exception = acquire_readable_stream_default_reader(*stream);
|
||||
auto reader_or_exception = stream->get_a_reader();
|
||||
if (reader_or_exception.is_exception())
|
||||
return WebIDL::create_rejected_promise_from_exception(realm, reader_or_exception.release_error());
|
||||
auto reader = reader_or_exception.release_value();
|
||||
|
@ -432,7 +432,7 @@ GC::Ref<WebIDL::Promise> Blob::bytes()
|
|||
auto stream = get_stream();
|
||||
|
||||
// 2. Let reader be the result of getting a reader from stream. If that threw an exception, return a new promise rejected with that exception.
|
||||
auto reader_or_exception = acquire_readable_stream_default_reader(*stream);
|
||||
auto reader_or_exception = stream->get_a_reader();
|
||||
if (reader_or_exception.is_exception())
|
||||
return WebIDL::create_rejected_promise_from_exception(realm, reader_or_exception.release_error());
|
||||
auto reader = reader_or_exception.release_value();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue