diff --git a/Libraries/LibJS/Runtime/NativeFunction.h b/Libraries/LibJS/Runtime/NativeFunction.h index e2f79aafdaa..a57d7b8f47b 100644 --- a/Libraries/LibJS/Runtime/NativeFunction.h +++ b/Libraries/LibJS/Runtime/NativeFunction.h @@ -42,7 +42,7 @@ private: virtual bool is_native_function() const override { return true; } virtual const char* class_name() const override { return "NativeFunction"; } - AK::Function)> m_native_function; + AK::Function&)> m_native_function; }; } diff --git a/Libraries/LibWeb/Bindings/DocumentWrapper.cpp b/Libraries/LibWeb/Bindings/DocumentWrapper.cpp index be4e404d793..8d9dcfa2955 100644 --- a/Libraries/LibWeb/Bindings/DocumentWrapper.cpp +++ b/Libraries/LibWeb/Bindings/DocumentWrapper.cpp @@ -36,7 +36,7 @@ namespace Bindings { DocumentWrapper::DocumentWrapper(Document& document) : NodeWrapper(document) { - put_native_function("getElementById", [this](JS::Object*, Vector arguments) -> JS::Value { + put_native_function("getElementById", [this](JS::Object*, const Vector& arguments) -> JS::Value { if (arguments.is_empty()) return JS::js_null(); auto id = arguments[0].to_string(); diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 881eead162b..4aa9746b2f4 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -341,7 +341,7 @@ JS::Interpreter& Document::interpreter() if (!m_interpreter) { m_interpreter = make(); - m_interpreter->global_object().put_native_function("alert", [](JS::Object*, Vector arguments) -> JS::Value { + m_interpreter->global_object().put_native_function("alert", [](JS::Object*, const Vector& arguments) -> JS::Value { if (arguments.size() < 1) return JS::js_undefined(); GUI::MessageBox::show(arguments[0].to_string(), "Alert", GUI::MessageBox::Type::Information);