|
@@ -134,18 +134,19 @@ void Node::dispatch_event(NonnullRefPtr<Event> event)
|
|
|
{
|
|
|
for (auto& listener : listeners()) {
|
|
|
if (listener.event_name == event->name()) {
|
|
|
- auto* function = const_cast<EventListener&>(*listener.listener).function();
|
|
|
+ auto& function = const_cast<EventListener&>(*listener.listener).function();
|
|
|
#ifdef EVENT_DEBUG
|
|
|
static_cast<const JS::ScriptFunction*>(function)->body().dump(0);
|
|
|
#endif
|
|
|
- auto* this_value = wrap(function->heap(), *this);
|
|
|
+ auto& heap = function.heap();
|
|
|
+ auto* this_value = wrap(heap, *this);
|
|
|
#ifdef EVENT_DEBUG
|
|
|
dbg() << "calling event listener with this=" << this_value;
|
|
|
#endif
|
|
|
- auto* event_wrapper = wrap(function->heap(), *event);
|
|
|
- JS::MarkedValueList arguments(function->heap());
|
|
|
+ auto* event_wrapper = wrap(heap, *event);
|
|
|
+ JS::MarkedValueList arguments(heap);
|
|
|
arguments.append(event_wrapper);
|
|
|
- document().interpreter().call(function, this_value, move(arguments));
|
|
|
+ document().interpreter().call(&function, this_value, move(arguments));
|
|
|
}
|
|
|
}
|
|
|
|