mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
LibRegex: Error out on Eof when parsing nonempty class range elements
Fixes #22507.
This commit is contained in:
parent
ee3d09f225
commit
267040dde7
Notes:
sideshowbarker
2024-07-16 22:58:46 +09:00
Author: https://github.com/alimpfard
Commit: 267040dde7
Pull-request: https://github.com/SerenityOS/serenity/pull/22518
Issue: https://github.com/SerenityOS/serenity/issues/22507
2 changed files with 18 additions and 0 deletions
|
@ -1963,6 +1963,11 @@ bool ECMA262Parser::parse_nonempty_class_ranges(Vector<CompareTypeAndValuePair>&
|
|||
return {};
|
||||
}
|
||||
|
||||
if (match(TokenType::Eof)) {
|
||||
set_error(Error::MismatchingBracket);
|
||||
return {};
|
||||
}
|
||||
|
||||
if (match(TokenType::RightBracket) || match(TokenType::HyphenMinus))
|
||||
return {};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue