diff options
author | Linus Groh <mail@linusgroh.de> | 2020-11-27 23:10:19 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-28 01:20:11 +0100 |
commit | b6e5442d55b5294fa8fc2c3728950dfb77b64a30 (patch) | |
tree | 9e3509ce76a54c6a28f1a466bd68f55b92eef792 /Libraries/LibJS/Tests | |
parent | ee66eaa1b03581a90ab24f3e27fab757a97a9fc6 (diff) | |
download | serenity-b6e5442d55b5294fa8fc2c3728950dfb77b64a30.zip |
LibJS: Make RegExp.prototype.toString() spec-compliant
It should use the 'source' and 'flags' properties of the object, and
therefore work with non-RegExp objects as well.
Diffstat (limited to 'Libraries/LibJS/Tests')
-rw-r--r-- | Libraries/LibJS/Tests/builtins/RegExp/RegExp.prototype.toString.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/builtins/RegExp/RegExp.prototype.toString.js b/Libraries/LibJS/Tests/builtins/RegExp/RegExp.prototype.toString.js index 5185fcc036..fcf132862d 100644 --- a/Libraries/LibJS/Tests/builtins/RegExp/RegExp.prototype.toString.js +++ b/Libraries/LibJS/Tests/builtins/RegExp/RegExp.prototype.toString.js @@ -2,4 +2,5 @@ test("basic functionality", () => { expect(RegExp.prototype.toString).toHaveLength(0); expect(/test/g.toString()).toBe("/test/g"); + expect(RegExp.prototype.toString.call({ source: "test", flags: "g" })).toBe("/test/g"); }); |