mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-27 01:56:21 +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
@@ -249,12 +249,12 @@ void SpecParsingStep::run(TranslationUnitRef translation_unit)
|
||||
|
||||
auto spec_function = SpecFunction::create(&m_document->root()).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
Vector<StringView> argument_names;
|
||||
Vector<FunctionArgument> arguments;
|
||||
for (auto const& argument : spec_function.m_arguments)
|
||||
argument_names.append(argument.name);
|
||||
arguments.append({ argument.name });
|
||||
|
||||
translation_unit->adopt_function(
|
||||
make_ref_counted<FunctionDefinition>(spec_function.m_name, spec_function.m_algorithm.m_tree, move(argument_names)));
|
||||
make_ref_counted<FunctionDefinition>(spec_function.m_name, spec_function.m_algorithm.m_tree, move(arguments)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user