mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +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:
parent
2c3077d929
commit
47ba231a9b
Notes:
github-actions[bot]
2025-01-21 13:59:36 +00:00
Author: https://github.com/trflynn89
Commit: 47ba231a9b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3324
3 changed files with 37 additions and 2 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue