mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibWeb: Start fleshing out the ReadableStream interface
This is so we can just assume it exists in Fetch APIs (while still skipping functionality that relies on a full implementation, of course).
This commit is contained in:
parent
1ace80235b
commit
87654f5b51
9 changed files with 199 additions and 4 deletions
23
Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp
Normal file
23
Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Streams/AbstractOperations.h>
|
||||
#include <LibWeb/Streams/ReadableStream.h>
|
||||
|
||||
namespace Web::Streams {
|
||||
|
||||
// https://streams.spec.whatwg.org/#is-readable-stream-locked
|
||||
bool is_readable_stream_locked(ReadableStream const& stream)
|
||||
{
|
||||
// 1. If stream.[[reader]] is undefined, return false.
|
||||
if (stream.reader() == nullptr)
|
||||
return false;
|
||||
|
||||
// 2. Return true.
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue