mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibJS: Fix crash in Lexer on EOF in unterminated template literal
Fixes #4252.
This commit is contained in:
parent
8284f87867
commit
ea08bf5812
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
Add a link
Reference in a new issue