From cc7462daeb8f99224517adce0b545868d6589374 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Sun, 7 Jun 2020 19:21:27 -0700 Subject: [PATCH] LibJS: Properly consume escaped backslash in regex literal --- Libraries/LibJS/Lexer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibJS/Lexer.cpp b/Libraries/LibJS/Lexer.cpp index 71ab328379..911dc6b808 100644 --- a/Libraries/LibJS/Lexer.cpp +++ b/Libraries/LibJS/Lexer.cpp @@ -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(); }