1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:28:13 +00:00

LibJS: Properly consume escaped backslash in regex literal

This commit is contained in:
Matthew Olsson 2020-06-07 19:21:27 -07:00 committed by Andreas Kling
parent 492df51e70
commit cc7462daeb

View file

@ -485,7 +485,7 @@ Token Lexer::next()
break;
}
if (match('\\', '/') || match('\\', '[') || (m_regex_is_in_character_class && match('\\', ']')))
if (match('\\', '/') || match('\\', '[') || match('\\', '\\') || (m_regex_is_in_character_class && match('\\', ']')))
consume();
consume();
}