mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
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:
Notes:
github-actions[bot]
2025-10-23 08:35:51 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/d32f99b16f2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6544 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user