LibRegex: Allow missing high bound in {x,y} quantifiers

Fixes #5518.
This commit is contained in:
AnotherTest 2021-02-26 23:23:58 +03:30 committed by Andreas Kling
commit e0ac85288e
Notes: sideshowbarker 2024-07-18 21:53:35 +09:00
2 changed files with 5 additions and 6 deletions

View file

@ -954,12 +954,10 @@ bool ECMA262Parser::parse_quantifier(ByteCode& stack, size_t& match_length_minim
if (match(TokenType::Comma)) {
consume();
auto high_bound = read_digits();
if (!high_bound.has_value()) {
set_error(Error::InvalidBraceContent);
return false;
}
repeat_max = high_bound.value();
if (high_bound.has_value())
repeat_max = high_bound.value();
} else {
repeat_max = repeat_min;
}
if (!match(TokenType::RightCurly)) {