LibJS: Emit token message for invalid numeric literals

This commit is contained in:
Linus Groh 2020-10-26 20:13:48 +00:00 committed by Andreas Kling
parent 19edcbd79c
commit 6a3389cec6
Notes: sideshowbarker 2024-07-19 01:41:32 +09:00

View file

@ -505,8 +505,10 @@ Token Lexer::next()
is_invalid_numeric_literal = !consume_exponent();
}
}
if (is_invalid_numeric_literal)
if (is_invalid_numeric_literal) {
token_type = TokenType::Invalid;
token_message = "Invalid numeric literal";
}
} else if (m_current_char == '"' || m_current_char == '\'') {
char stop_char = m_current_char;
consume();