LibJS: Fix that a windows-style new line was not escaped properly

This commit is contained in:
davidot 2021-07-25 00:50:14 +02:00 committed by Linus Groh
commit 4cc95ae39d
Notes: sideshowbarker 2024-07-18 05:37:23 +09:00

View file

@ -549,6 +549,9 @@ Token Lexer::next()
while (m_current_char != stop_char && m_current_char != '\r' && m_current_char != '\n' && !is_eof()) {
if (m_current_char == '\\') {
consume();
if (m_current_char == '\r' && m_position < m_source.length() && m_source[m_position] == '\n') {
consume();
}
}
consume();
}