1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

LibJS: Make RegExp.prototype.flags spec-compliant

This should be using the individual flag boolean properties rather than
the [[OriginalFlags]] internal slot.
Use an enumerator macro here for brevity, this will be useful for other
things as well. :^)
This commit is contained in:
Linus Groh 2020-11-27 23:04:01 +00:00 committed by Andreas Kling
parent 5cb45e4feb
commit ee66eaa1b0
3 changed files with 38 additions and 15 deletions

View file

@ -0,0 +1,10 @@
test("basic functionality", () => {
expect(/foo/.flags).toBe("");
expect(/foo/g.flags).toBe("g");
expect(/foo/i.flags).toBe("i");
expect(/foo/m.flags).toBe("m");
expect(/foo/s.flags).toBe("s");
expect(/foo/u.flags).toBe("u");
expect(/foo/y.flags).toBe("y");
expect(/foo/sgimyu.flags).toBe("gimsuy");
});