1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:27:46 +00:00

LibJS: Implement global RegExp.prototype.match

Also rename the 'rx' variable to 'regexp_object' to match other RegExp
methods.
This commit is contained in:
Timothy Flynn 2021-07-07 14:11:46 -04:00 committed by Linus Groh
parent b6b5adb47d
commit 2d0589f93c
2 changed files with 73 additions and 17 deletions

View file

@ -3,6 +3,12 @@ test("basic functionality", () => {
expect("hello friends".match(/hello/)).not.toBeNull();
expect("hello friends".match(/enemies/)).toBeNull();
expect("aaa".match(/a/)).toEqual(["a"]);
expect("aaa".match(/a/g)).toEqual(["a", "a", "a"]);
expect("aaa".match(/b/)).toBeNull();
expect("aaa".match(/b/g)).toBeNull();
});
test("override exec with function", () => {