From 5586340cf300bcb3d2240e9c90a5119aa6c54788 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Wed, 8 Nov 2023 11:41:40 -0700 Subject: [PATCH] LibWeb: Don't set EventTarget prototype on any WindowOrWorkerGlobalScope The same limitations regarding construction of Window apply to all WorkerGlobalScope classes as well. --- Userland/Libraries/LibWeb/DOM/EventTarget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp index aaf5548b7c..3a137644c5 100644 --- a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp +++ b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp @@ -56,9 +56,9 @@ void EventTarget::initialize(JS::Realm& realm) { Base::initialize(realm); - // FIXME: We can't do this for HTML::Window currently, as this will run when creating the initial global object. + // FIXME: We can't do this for HTML::Window or HTML::WorkerGlobalScope, as this will run when creating the initial global object. // During this time, the ESO is not setup, so it will cause a nullptr dereference in host_defined_intrinsics. - if (!is(this)) + if (!is(this)) set_prototype(&Bindings::ensure_web_prototype(realm, "EventTarget")); }