summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/DOM/XMLHttpRequest.cpp
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-08-25 22:18:32 +0430
committerAndreas Kling <kling@serenityos.org>2020-08-26 08:45:01 +0200
commit394e4c04cd5dfdca56f67e6384288a209bdbf6dc (patch)
tree92332e13de789afa219e69a77fedb5806c513018 /Libraries/LibWeb/DOM/XMLHttpRequest.cpp
parent521e730df107db3565880b79c6d6a7e66132787e (diff)
downloadserenity-394e4c04cd5dfdca56f67e6384288a209bdbf6dc.zip
LibJS: Add a helper for calling JS::Function's with arguments
The fact that a `MarkedValueList` had to be created was just annoying, so here's an alternative. This patchset also removes some (now) unneeded MarkedValueList.h includes.
Diffstat (limited to 'Libraries/LibWeb/DOM/XMLHttpRequest.cpp')
-rw-r--r--Libraries/LibWeb/DOM/XMLHttpRequest.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Libraries/LibWeb/DOM/XMLHttpRequest.cpp b/Libraries/LibWeb/DOM/XMLHttpRequest.cpp
index b75d272701..cb95b89566 100644
--- a/Libraries/LibWeb/DOM/XMLHttpRequest.cpp
+++ b/Libraries/LibWeb/DOM/XMLHttpRequest.cpp
@@ -96,10 +96,8 @@ void XMLHttpRequest::dispatch_event(NonnullRefPtr<DOM::Event> event)
auto& function = const_cast<DOM::EventListener&>(*listener.listener).function();
auto& global_object = function.global_object();
auto* this_value = wrap(global_object, *this);
- JS::MarkedValueList arguments(global_object.heap());
- arguments.append(wrap(global_object, *event));
auto& interpreter = function.interpreter();
- (void)interpreter.call(function, this_value, move(arguments));
+ (void)interpreter.call(function, this_value, wrap(global_object, *this));
if (interpreter.exception())
interpreter.clear_exception();
}