mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-22 11:02:53 +00:00
JSSpecCompiler: Save references to return value and function arguments
This commit is contained in:
parent
7f47340c82
commit
5825eaa264
Notes:
sideshowbarker
2024-07-17 07:38:17 +09:00
Author: https://github.com/DanShaders
Commit: 5825eaa264
Pull-request: https://github.com/SerenityOS/serenity/pull/22751
Reviewed-by: https://github.com/ADKaster ✅
10 changed files with 89 additions and 49 deletions
|
@ -196,11 +196,12 @@ void SpecParsingStep::run(TranslationUnitRef translation_unit)
|
|||
|
||||
auto spec_function = SpecFunction::create(&m_document->root()).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
auto* function = translation_unit->adopt_function(
|
||||
make_ref_counted<FunctionDefinition>(spec_function.m_name, spec_function.m_algorithm.m_tree));
|
||||
|
||||
Vector<StringView> argument_names;
|
||||
for (auto const& argument : spec_function.m_arguments)
|
||||
function->m_local_variables.set(argument.name, make_ref_counted<NamedVariableDeclaration>(argument.name));
|
||||
argument_names.append(argument.name);
|
||||
|
||||
translation_unit->adopt_function(
|
||||
make_ref_counted<FunctionDefinition>(spec_function.m_name, spec_function.m_algorithm.m_tree, move(argument_names)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue