AbstractOperations.cpp 515 B

1234567891011121314151617181920212223
  1. /*
  2. * Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Streams/AbstractOperations.h>
  7. #include <LibWeb/Streams/ReadableStream.h>
  8. namespace Web::Streams {
  9. // https://streams.spec.whatwg.org/#is-readable-stream-locked
  10. bool is_readable_stream_locked(ReadableStream const& stream)
  11. {
  12. // 1. If stream.[[reader]] is undefined, return false.
  13. if (stream.reader() == nullptr)
  14. return false;
  15. // 2. Return true.
  16. return true;
  17. }
  18. }