LibWeb: Explicitly clear read requests for default stream reader

Expecting the list to be cleared from the move() is quite strange and
not particularly clear. Explicitly clear the requests instead.
This commit is contained in:
Shannon Booth 2023-08-31 20:48:32 +12:00 committed by Andrew Kaster
parent c279d514e9
commit e08072ac2b

View file

@ -425,9 +425,11 @@ WebIDL::ExceptionOr<void> readable_stream_reader_generic_release(ReadableStreamG
void readable_stream_default_reader_error_read_requests(ReadableStreamDefaultReader& reader, JS::Value error)
{
// 1. Let readRequests be reader.[[readRequests]].
// 2. Set reader.[[readRequests]] to a new empty list.
auto read_requests = move(reader.read_requests());
// 2. Set reader.[[readRequests]] to a new empty list.
reader.read_requests().clear();
// 3. For each readRequest of readRequests,
for (auto& read_request : read_requests) {
// 1. Perform readRequests error steps, given e.