LibJS: Remember arrow function parsing failures by offset

We don't need to remember these by (line, column, offset). Just the
offset should be enough.
This commit is contained in:
Andreas Kling 2024-09-02 11:42:48 +02:00 committed by Andreas Kling
commit 2e06d26ddb
Notes: github-actions[bot] 2024-09-02 13:23:45 +00:00
2 changed files with 3 additions and 16 deletions

View file

@ -4487,7 +4487,7 @@ Position Parser::position() const
bool Parser::try_parse_arrow_function_expression_failed_at_position(Position const& position) const
{
auto it = m_token_memoizations.find(position);
auto it = m_token_memoizations.find(position.offset);
if (it == m_token_memoizations.end())
return false;
@ -4496,7 +4496,7 @@ bool Parser::try_parse_arrow_function_expression_failed_at_position(Position con
void Parser::set_try_parse_arrow_function_expression_failed_at_position(Position const& position, bool failed)
{
m_token_memoizations.set(position, { failed });
m_token_memoizations.set(position.offset, { failed });
}
void Parser::syntax_error(ByteString const& message, Optional<Position> position)