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:
parent
b6b5adb47d
commit
2d0589f93c
2 changed files with 73 additions and 17 deletions
|
@ -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", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue