mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 05:51:55 +00:00
LibWeb: Pass abort signal as its concrete type to ReadableStreamPipeTo
There's no real need to wrap it in a JS::Value just to unrwap it again.
This commit is contained in:
parent
ab43c3be23
commit
3033929bb6
Notes:
github-actions[bot]
2025-04-11 16:12:19 +00:00
Author: https://github.com/trflynn89
Commit: 3033929bb6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4311
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/shannonbooth ✅
4 changed files with 7 additions and 9 deletions
|
@ -290,7 +290,7 @@ bool readable_stream_has_default_reader(ReadableStream const& stream)
|
|||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#readable-stream-pipe-to
|
||||
GC::Ref<WebIDL::Promise> readable_stream_pipe_to(ReadableStream& source, WritableStream& dest, bool, bool, bool, JS::Value signal)
|
||||
GC::Ref<WebIDL::Promise> readable_stream_pipe_to(ReadableStream& source, WritableStream& dest, bool, bool, bool, GC::Ptr<DOM::AbortSignal> signal)
|
||||
{
|
||||
auto& realm = source.realm();
|
||||
|
||||
|
@ -299,10 +299,8 @@ GC::Ref<WebIDL::Promise> readable_stream_pipe_to(ReadableStream& source, Writabl
|
|||
// 3. Assert: preventClose, preventAbort, and preventCancel are all booleans.
|
||||
|
||||
// 4. If signal was not given, let signal be undefined.
|
||||
// NOTE: Done by default argument
|
||||
|
||||
// 5. Assert: either signal is undefined, or signal implements AbortSignal.
|
||||
VERIFY(signal.is_undefined() || (signal.is_object() && is<DOM::AbortSignal>(signal.as_object())));
|
||||
(void)signal;
|
||||
|
||||
// 6. Assert: ! IsReadableStreamLocked(source) is false.
|
||||
VERIFY(!is_readable_stream_locked(source));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue