1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

JSSpecCompiler: Properly parse function calls with zero arguments

We cannot handle them normally since we need text between parenthesis to
be a valid expression. As a workaround, we now push an artificial value
to stack to act as an argument (it'll be later removed during function
call canonicalization).
This commit is contained in:
Dan Klishch 2024-01-16 00:21:59 -05:00 committed by Andrew Kaster
parent 14ee25b8ba
commit 33b36476d9
4 changed files with 50 additions and 1 deletions

View file

@ -35,6 +35,14 @@ void ErrorNode::dump_tree(StringBuilder& builder)
dump_node(builder, "Error \"{}\"", m_error);
}
void WellKnownNode::dump_tree(StringBuilder& builder)
{
static constexpr StringView type_to_name[] = {
"ZeroArgumentFunctionCall"sv,
};
dump_node(builder, "WellKnownNode {}", type_to_name[m_type]);
}
void ControlFlowFunctionReturn::dump_tree(StringBuilder& builder)
{
dump_node(builder, "ControlFlowFunctionReturn");