Skip to content

Commit 81e18a9

Browse files
committed
LibWeb: Silence some debug spam about JS event handler invocations
1 parent 7c48c3c commit 81e18a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Libraries/LibWeb/DOM/Node.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
#include <LibWeb/Layout/LayoutNode.h>
4444
#include <LibWeb/Layout/LayoutText.h>
4545

46+
//#define EVENT_DEBUG
47+
4648
namespace Web {
4749

4850
Node::Node(Document& document, NodeType type)
@@ -130,9 +132,13 @@ void Node::dispatch_event(NonnullRefPtr<Event> event)
130132
for (auto& listener : listeners()) {
131133
if (listener.event_name == event->name()) {
132134
auto* function = const_cast<EventListener&>(*listener.listener).function();
135+
#ifdef EVENT_DEBUG
133136
static_cast<const JS::ScriptFunction*>(function)->body().dump(0);
137+
#endif
134138
auto* this_value = wrap(function->heap(), *this);
139+
#ifdef EVENT_DEBUG
135140
dbg() << "calling event listener with this=" << this_value;
141+
#endif
136142
auto* event_wrapper = wrap(function->heap(), *event);
137143
document().interpreter().call(function, this_value, { event_wrapper });
138144
}

0 commit comments

Comments
 (0)