mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibJS: Fix crash in Lexer on EOF in unterminated template literal
Fixes #4252.
This commit is contained in:
parent
8284f87867
commit
ea08bf5812
Notes:
sideshowbarker
2024-07-19 01:10:06 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/ea08bf58126 Pull-request: https://github.com/SerenityOS/serenity/pull/4254 Issue: https://github.com/SerenityOS/serenity/issues/4252
1 changed files with 4 additions and 2 deletions
|
@ -451,8 +451,10 @@ Token Lexer::next()
|
|||
consume();
|
||||
consume();
|
||||
}
|
||||
|
||||
token_type = TokenType::TemplateLiteralString;
|
||||
if (is_eof() && !m_template_states.is_empty())
|
||||
token_type = TokenType::UnterminatedTemplateLiteral;
|
||||
else
|
||||
token_type = TokenType::TemplateLiteralString;
|
||||
}
|
||||
} else if (is_identifier_start()) {
|
||||
// identifier or keyword
|
||||
|
|
Loading…
Add table
Reference in a new issue