mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +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:
committed by
Andrew Kaster
parent
0806ccaeec
commit
483e195e48
@@ -40,15 +40,15 @@ FunctionDeclarationRef TranslationUnit::find_declaration_by_name(StringView name
|
||||
return it->value;
|
||||
}
|
||||
|
||||
FunctionDeclaration::FunctionDeclaration(StringView name)
|
||||
FunctionDeclaration::FunctionDeclaration(StringView name, Vector<FunctionArgument>&& arguments)
|
||||
: m_name(name)
|
||||
, m_arguments(arguments)
|
||||
{
|
||||
}
|
||||
|
||||
FunctionDefinition::FunctionDefinition(StringView name, Tree ast, Vector<StringView>&& argument_names)
|
||||
: FunctionDeclaration(name)
|
||||
FunctionDefinition::FunctionDefinition(StringView name, Tree ast, Vector<FunctionArgument>&& arguments)
|
||||
: FunctionDeclaration(name, move(arguments))
|
||||
, m_ast(move(ast))
|
||||
, m_argument_names(move(argument_names))
|
||||
, m_named_return_value(make_ref_counted<NamedVariableDeclaration>("$return"sv))
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user