summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp
blob: ac1045b7070ac59ee0ca04256fb6bbab040506b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
}

}