소스 검색

LibJS: Properly consume escaped backslash in regex literal

Matthew Olsson 5 년 전
부모
커밋
cc7462daeb
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Libraries/LibJS/Lexer.cpp

+ 1 - 1
Libraries/LibJS/Lexer.cpp

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