mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
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:
parent
d5a0bb9159
commit
2e06d26ddb
Notes:
github-actions[bot]
2024-09-02 13:23:45 +00:00
Author: https://github.com/awesomekling
Commit: 2e06d26ddb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1247
2 changed files with 3 additions and 16 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue