LibJS: Remove support for the "assert" keyword for import attributes

This was removed from the spec some time ago. See:
14286bb
This commit is contained in:
Timothy Flynn 2025-01-20 12:07:29 -05:00 committed by Andreas Kling
commit b64a355a30
Notes: github-actions[bot] 2025-01-21 13:59:26 +00:00
7 changed files with 14 additions and 31 deletions

View file

@ -4544,13 +4544,6 @@ void Parser::check_identifier_name_for_assignment_validity(DeprecatedFlyString c
}
}
bool Parser::match_with_clause() const
{
if (m_state.current_token.original_value() == "with"sv)
return true;
return !m_state.current_token.trivia_contains_line_terminator() && m_state.current_token.original_value() == "assert"sv;
}
DeprecatedFlyString Parser::consume_string_value()
{
VERIFY(match(TokenType::StringLiteral));
@ -4585,11 +4578,10 @@ ModuleRequest Parser::parse_module_request()
ModuleRequest request { consume_string_value() };
if (!match_with_clause())
if (!match(TokenType::With))
return request;
VERIFY(m_state.current_token.original_value().is_one_of("with"sv, "assert"sv));
consume();
consume(TokenType::With);
consume(TokenType::CurlyOpen);
while (!done() && !match(TokenType::CurlyClose)) {