summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2020-06-07 19:21:27 -0700
committerAndreas Kling <kling@serenityos.org>2020-06-08 09:18:27 +0200
commitcc7462daeb8f99224517adce0b545868d6589374 (patch)
treef96d6bb99282a45d394f94e07c61cfda1614de48 /Libraries
parent492df51e70e974d3e6ca8bfd0f26782da660fd2d (diff)
downloadserenity-cc7462daeb8f99224517adce0b545868d6589374.zip
LibJS: Properly consume escaped backslash in regex literal
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibJS/Lexer.cpp2
1 files changed, 1 insertions, 1 deletions
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();
}