1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:48:14 +00:00

LibJS+LibWeb: Fix some inconsistencies in NativeFunction callbacks

These should always pass the arguments in a const Vector<JS::Value>&.
This commit is contained in:
Andreas Kling 2020-03-21 14:43:44 +01:00
parent 324b92fd06
commit 08b17d70af
3 changed files with 3 additions and 3 deletions

View file

@ -341,7 +341,7 @@ JS::Interpreter& Document::interpreter()
if (!m_interpreter) {
m_interpreter = make<JS::Interpreter>();
m_interpreter->global_object().put_native_function("alert", [](JS::Object*, Vector<JS::Value> arguments) -> JS::Value {
m_interpreter->global_object().put_native_function("alert", [](JS::Object*, const Vector<JS::Value>& arguments) -> JS::Value {
if (arguments.size() < 1)
return JS::js_undefined();
GUI::MessageBox::show(arguments[0].to_string(), "Alert", GUI::MessageBox::Type::Information);