diff options
-rw-r--r-- | Libraries/LibJS/Lexer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Libraries/LibJS/Lexer.cpp b/Libraries/LibJS/Lexer.cpp index c9eeebd3a2..74af67b9ea 100644 --- a/Libraries/LibJS/Lexer.cpp +++ b/Libraries/LibJS/Lexer.cpp @@ -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 |