LibWeb: Ensure all passed arguments are used when parsing math functions

This disallows things such as `log(1, foobar)` where we would previously
just skip over `foobar` and parse this as `log(1)`
This commit is contained in:
Callum Law 2025-10-22 17:27:08 +13:00 committed by Sam Atkins
parent 1977a976da
commit d32f99b16f
Notes: github-actions[bot] 2025-10-23 08:35:51 +00:00
2 changed files with 7 additions and 4 deletions

View file

@ -417,6 +417,10 @@ RefPtr<CalculationNode const> Parser::parse_math_function(Function const& functi
parameter_index++;
});
function_generator.append(R"~~~(
if (argument_index < arguments.size())
return nullptr;
)~~~");
// Generate the call to the constructor
function_generator.append(" return @name:titlecase@CalculationNode::create("sv);
parameter_index = 0;