mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 04:08:08 +00:00
LibJS: Do not consume "with" tokens in import statements as identifiers
The "with" statement is its own token (TokenType::With), and thus would fail to parse as an identifier. We've already asserted that the token we are parsing is "with" or "assert", so just consume it.
This commit is contained in:
committed by
Andreas Kling
parent
2c3077d929
commit
47ba231a9b
@@ -4589,7 +4589,7 @@ ModuleRequest Parser::parse_module_request()
|
||||
return request;
|
||||
|
||||
VERIFY(m_state.current_token.original_value().is_one_of("with"sv, "assert"sv));
|
||||
consume(TokenType::Identifier);
|
||||
consume();
|
||||
consume(TokenType::CurlyOpen);
|
||||
|
||||
while (!done() && !match(TokenType::CurlyClose)) {
|
||||
|
||||
Reference in New Issue
Block a user