mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 05:08:56 +00:00
LibRegex: Stop trying to read a character class when no tokens remain
e.g. in "[". Fixes #4186.
This commit is contained in:
committed by
Andreas Kling
parent
2adcdbcc1e
commit
e83e7a03c2
@@ -1236,6 +1236,11 @@ bool ECMA262Parser::parse_nonempty_class_ranges(Vector<CompareTypeAndValuePair>&
|
||||
};
|
||||
|
||||
while (!match(TokenType::RightBracket)) {
|
||||
if (match(TokenType::Eof)) {
|
||||
set_error(Error::MismatchingBracket);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto first_atom = read_class_atom();
|
||||
if (!first_atom.has_value())
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user