LibJS: Switch Agent [[CanBlock]] slot to a enum member

It turns out it was a mistake to make this a virtual since
ServiceWorkerAgents are effectively the exact same as
DedicatedWorkerAgents and SharedWorkerAgents just with [[CanBlock]]
set to false.
This commit is contained in:
Shannon Booth 2025-04-24 16:16:08 +12:00 committed by Andreas Kling
parent 7dd7e5b438
commit 5290ebfe19
Notes: github-actions[bot] 2025-04-25 14:45:34 +00:00
6 changed files with 31 additions and 9 deletions

View file

@ -77,7 +77,7 @@ void initialize_main_thread_vm(HTML::EventLoop::Type type)
VERIFY(!s_main_thread_vm);
s_main_thread_vm = JS::VM::create();
s_main_thread_vm->set_agent(make<HTML::SimilarOriginWindowAgent>());
s_main_thread_vm->set_agent(HTML::SimilarOriginWindowAgent::create());
auto& agent = as<HTML::Agent>(*s_main_thread_vm->agent());
agent.event_loop = s_main_thread_vm->heap().allocate<HTML::EventLoop>(type);