mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00: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:
parent
1977a976da
commit
d32f99b16f
Notes:
github-actions[bot]
2025-10-23 08:35:51 +00:00
Author: https://github.com/Calme1709
Commit: d32f99b16f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6544
Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 7 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue