1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-27 20:45:08 +00:00
serenity/Userland/Libraries/LibJS/Tests/builtins/RegExp
Linus Groh e46fa3ac8b LibJS: Keep RegExp.exec() results in correct order
By using regex::AllFlags::SkipTrimEmptyMatches we get a null string for
unmatched capture groups, which we then turn into an undefined entry in
the result array instead of putting all matches first and appending
undefined for the remaining number of capture groups - e.g. for

    /foo(ba((r)|(z)))/.exec("foobaz")

we now return

    ["foobaz", "baz", "z", undefined, "z"]

and not [

    ["foobaz", "baz", "z", "z", undefined]

Fixes part of #6042.

Also happens to fix selecting an element by ID using jQuery's $("#foo").
2021-04-03 16:34:34 +02:00
..
RegExp.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
RegExp.prototype.exec.js LibJS: Keep RegExp.exec() results in correct order 2021-04-03 16:34:34 +02:00
RegExp.prototype.flags.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
RegExp.prototype.source.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
RegExp.prototype.test.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
RegExp.prototype.toString.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00