1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:17:34 +00:00

LibWeb: Get argument count from Function::parameters::size()

Previously this retrieved argument count from Function::length() which
did not return the correct count in all situations.
This commit is contained in:
Kenneth Myhra 2022-04-03 18:36:36 +02:00 committed by Andreas Kling
parent ba23d036bd
commit 887e13f364

View file

@ -1530,7 +1530,7 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@function.name:snakecase@)
auto fetched_arguments = 0u;
for (auto i = 0u; i < overloaded_functions.size(); ++i) {
auto const& overloaded_function = overloaded_functions[i];
auto argument_count = overloaded_function.length();
auto argument_count = overloaded_function.parameters.size();
function_generator.set("argument_count", String::number(argument_count));
function_generator.set("arguments_match_check", generate_arguments_match_check(overloaded_function));