Ver código fonte

LibJS: Properly consume escaped backslash in regex literal

Matthew Olsson 5 anos atrás
pai
commit
cc7462daeb
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      Libraries/LibJS/Lexer.cpp

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