Skip to content

Commit

Permalink
LibWeb: Enable callbacks in chunk steps for ReadableStreamDefaultTee
Browse files Browse the repository at this point in the history
We enqueue a microtask for this readable stream AO, and the methods that
we call from the chunk steps manipulate promises. As such, we need to
enable callbacks for the entire microtask's temporary execution
context.
  • Loading branch information
ADKaster authored and awesomekling committed May 23, 2024
1 parent bab5464 commit a68222f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class DefaultStreamTeeReadRequest final : public ReadRequest {
{
// 1. Queue a microtask to perform the following steps:
HTML::queue_a_microtask(nullptr, JS::create_heap_function(m_realm->heap(), [this, chunk]() {
HTML::TemporaryExecutionContext execution_context { Bindings::host_defined_environment_settings_object(m_realm) };
HTML::TemporaryExecutionContext execution_context { Bindings::host_defined_environment_settings_object(m_realm), HTML::TemporaryExecutionContext::CallbacksEnabled::Yes };

auto controller1 = m_params->branch1->controller()->get<JS::NonnullGCPtr<ReadableStreamDefaultController>>();
auto controller2 = m_params->branch2->controller()->get<JS::NonnullGCPtr<ReadableStreamDefaultController>>();
Expand Down

0 comments on commit a68222f

Please sign in to comment.