mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
LibJS: Set empty function parameters on ClassStaticInit scope
This prevents the variables declared inside a class static initializer to escape to the nearest containing function causing all sorts of memory corruptions.
This commit is contained in:
parent
6aea459e00
commit
08cfd5ff1b
Notes:
github-actions[bot]
2025-04-05 17:21:29 +00:00
Author: https://github.com/devgianlu
Commit: 08cfd5ff1b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4226
2 changed files with 19 additions and 0 deletions
|
@ -1537,6 +1537,8 @@ NonnullRefPtr<ClassExpression const> Parser::parse_class_expression(bool expect_
|
|||
|
||||
{
|
||||
ScopePusher static_init_scope = ScopePusher::static_init_block_scope(*this, *static_init_block);
|
||||
static_init_scope.set_function_parameters(FunctionParameters::empty());
|
||||
|
||||
parse_statement_list(static_init_block);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue