From 81e18a9b26c010984e6362ff2485eca9aeaca77c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 21 Mar 2020 18:55:12 +0100 Subject: [PATCH] LibWeb: Silence some debug spam about JS event handler invocations --- Libraries/LibWeb/DOM/Node.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Libraries/LibWeb/DOM/Node.cpp b/Libraries/LibWeb/DOM/Node.cpp index 315aec5f3b..f4f3e41ccf 100644 --- a/Libraries/LibWeb/DOM/Node.cpp +++ b/Libraries/LibWeb/DOM/Node.cpp @@ -43,6 +43,8 @@ #include #include +//#define EVENT_DEBUG + namespace Web { Node::Node(Document& document, NodeType type) @@ -130,9 +132,13 @@ void Node::dispatch_event(NonnullRefPtr event) for (auto& listener : listeners()) { if (listener.event_name == event->name()) { auto* function = const_cast(*listener.listener).function(); +#ifdef EVENT_DEBUG static_cast(function)->body().dump(0); +#endif auto* this_value = wrap(function->heap(), *this); +#ifdef EVENT_DEBUG dbg() << "calling event listener with this=" << this_value; +#endif auto* event_wrapper = wrap(function->heap(), *event); document().interpreter().call(function, this_value, { event_wrapper }); }