1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:57:44 +00:00

LibJS: Rename Function => FunctionObject

This commit is contained in:
Andreas Kling 2021-06-27 21:48:34 +02:00
parent e389ae3c97
commit ba9d5c4d54
114 changed files with 263 additions and 262 deletions

View file

@ -8,7 +8,7 @@
#include <AK/String.h>
#include <LibJS/Heap/Handle.h>
#include <LibJS/Runtime/Function.h>
#include <LibJS/Runtime/FunctionObject.h>
namespace Web::HTML {
@ -22,13 +22,13 @@ struct EventHandler {
{
}
EventHandler(JS::Handle<JS::Function> c)
EventHandler(JS::Handle<JS::FunctionObject> c)
: callback(move(c))
{
}
String string;
JS::Handle<JS::Function> callback;
JS::Handle<JS::FunctionObject> callback;
};
}

View file

@ -51,7 +51,7 @@ void GlobalEventHandlers::set_event_handler_attribute(const FlyString& name, HTM
}
auto* function = JS::ScriptFunction::create(self.script_execution_context()->interpreter().global_object(), name, program->body(), program->parameters(), program->function_length(), nullptr, JS::FunctionKind::Regular, false, false);
VERIFY(function);
listener = adopt_ref(*new DOM::EventListener(JS::make_handle(static_cast<JS::Function*>(function))));
listener = adopt_ref(*new DOM::EventListener(JS::make_handle(static_cast<JS::FunctionObject*>(function))));
}
if (listener) {
for (auto& registered_listener : self.listeners()) {

View file

@ -6,7 +6,7 @@
#include <LibJS/Interpreter.h>
#include <LibJS/Parser.h>
#include <LibJS/Runtime/Function.h>
#include <LibJS/Runtime/FunctionObject.h>
#include <LibJS/Runtime/ScriptFunction.h>
#include <LibProtocol/WebSocket.h>
#include <LibProtocol/WebSocketClient.h>
@ -248,7 +248,7 @@ void WebSocket::set_event_handler_attribute(const FlyString& name, HTML::EventHa
}
auto* function = JS::ScriptFunction::create(script_execution_context()->interpreter().global_object(), name, program->body(), program->parameters(), program->function_length(), nullptr, JS::FunctionKind::Regular, false, false);
VERIFY(function);
listener = adopt_ref(*new DOM::EventListener(JS::make_handle(static_cast<JS::Function*>(function))));
listener = adopt_ref(*new DOM::EventListener(JS::make_handle(static_cast<JS::FunctionObject*>(function))));
}
if (listener) {
for (auto& registered_listener : listeners()) {