LibWeb: Enable callbacks in chunk steps for ReadableStreamDefaultTee

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.
This commit is contained in:
Andrew Kaster
2024-05-23 03:16:55 -06:00
committed by Andreas Kling
parent bab546472e
commit a68222f654
Notes: sideshowbarker 2024-07-17 18:49:10 +09:00

View File

@@ -401,7 +401,7 @@ public:
{
// 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>>();