mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibJS: Fix crash in Lexer on EOF in unterminated template literal
Fixes #4252.
This commit is contained in:
committed by
Andreas Kling
parent
8284f87867
commit
ea08bf5812
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user