summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/DOM/EventDispatcher.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-09-20 19:22:44 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-20 19:22:44 +0200
commitc6ae0c41d908ae59a858a28a737b4382cceaeb6c (patch)
tree1de5f866114b541956eabb772c4b9f14aa128160 /Libraries/LibWeb/DOM/EventDispatcher.cpp
parent976e55e942a186143612b5503358469d2f012bf3 (diff)
downloadserenity-c6ae0c41d908ae59a858a28a737b4382cceaeb6c.zip
LibWeb: Add Bindings::ScriptExecutionContext
This will be inherited by documents and workers, to provide a common abstraction for script execution. (We don't have workers yet, but we might as well make this little space for them now to simplify things down the road.)
Diffstat (limited to 'Libraries/LibWeb/DOM/EventDispatcher.cpp')
-rw-r--r--Libraries/LibWeb/DOM/EventDispatcher.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Libraries/LibWeb/DOM/EventDispatcher.cpp b/Libraries/LibWeb/DOM/EventDispatcher.cpp
index 45b30f008f..bbdbbbc065 100644
--- a/Libraries/LibWeb/DOM/EventDispatcher.cpp
+++ b/Libraries/LibWeb/DOM/EventDispatcher.cpp
@@ -27,6 +27,7 @@
#include <LibJS/Runtime/Function.h>
#include <LibWeb/Bindings/EventTargetWrapper.h>
#include <LibWeb/Bindings/EventTargetWrapperFactory.h>
+#include <LibWeb/Bindings/ScriptExecutionContext.h>
#include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/EventDispatcher.h>
#include <LibWeb/DOM/EventListener.h>
@@ -43,7 +44,8 @@ void EventDispatcher::dispatch(EventTarget& target, NonnullRefPtr<Event> event)
auto& function = listener.listener->function();
auto& global_object = function.global_object();
auto* this_value = Bindings::wrap(global_object, target);
- auto& interpreter = function.interpreter();
+
+ auto& interpreter = target.script_execution_context()->interpreter();
(void)interpreter.call(function, this_value, Bindings::wrap(global_object, target));
if (interpreter.exception())
interpreter.clear_exception();