1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

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
parent ba622cffe4
commit 4cc95ae39d

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();
}