1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:47:34 +00:00

LibRegex: Break from execution loop when the sticky flag is set

If the sticky flag is set, the regex execution loop should break
immediately even if the execution was a failure. The specification for
several RegExp.prototype methods (e.g. exec and @@split) rely on this
behavior.
This commit is contained in:
Timothy Flynn 2021-07-09 09:33:02 -04:00 committed by Linus Groh
parent 3892b6e6ec
commit 0f0ac37b56
2 changed files with 3 additions and 1 deletions

View file

@ -237,7 +237,7 @@ RegexResult Matcher<Parser>::match(const Vector<RegexStringView> views, Optional
break;
}
if (!continue_search && !input.regex_options.has_flag_set(AllFlags::Internal_Stateful))
if (!continue_search)
break;
}