mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +00:00
LibRegex: Disallow unescaped quantifiers in Unicode mode
This commit is contained in:
parent
c3e1f1f687
commit
1a173be29d
2 changed files with 9 additions and 0 deletions
|
@ -1290,6 +1290,9 @@ bool ECMA262Parser::parse_atom(ByteCode& stack, size_t& match_length_minimum, bo
|
|||
}
|
||||
|
||||
if (match(TokenType::RightBracket) || match(TokenType::RightCurly) || match(TokenType::LeftCurly)) {
|
||||
if (unicode)
|
||||
return set_error(Error::InvalidPattern);
|
||||
|
||||
if (m_should_use_browser_extended_grammar) {
|
||||
auto token = consume();
|
||||
match_length_minimum += 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue