1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 22:15:06 +00:00

JSSpecCompiler: Store arguments in declaration instead of definition

And create a struct encapsulating argument name in the preparation for
argument types and optional arguments.
This commit is contained in:
Dan Klishch 2024-01-15 23:02:35 -05:00 committed by Andrew Kaster
parent 0806ccaeec
commit 483e195e48
8 changed files with 57 additions and 40 deletions

View file

@ -14,8 +14,8 @@ namespace JSSpecCompiler {
void ReferenceResolvingPass::process_function()
{
for (auto name : m_function->m_argument_names)
m_function->m_local_variables.set(name, make_ref_counted<NamedVariableDeclaration>(name));
for (auto argument : m_function->m_arguments)
m_function->m_local_variables.set(argument.name, make_ref_counted<NamedVariableDeclaration>(argument.name));
GenericASTPass::process_function();
}