summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-11-03 19:39:02 +0000
committerAndreas Kling <kling@serenityos.org>2020-11-04 19:33:49 +0100
commite163db248ded5a74f6233a4e57f53c10d839ecf5 (patch)
tree9de675e38a06debd587afdd2aa4c5096d97be503 /Libraries/LibJS/Tests
parent41837f548df6f6cde6b798cf1421b2d2d1cabcfc (diff)
downloadserenity-e163db248ded5a74f6233a4e57f53c10d839ecf5.zip
LibJS: Implement RegExp.prototype.toString() as standalone function
This should not just inherit Object.prototype.toString() (and override Object::to_string()) but be its own function, i.e. 'RegExp.prototype.toString !== Object.prototype.toString'.
Diffstat (limited to 'Libraries/LibJS/Tests')
-rw-r--r--Libraries/LibJS/Tests/builtins/RegExp/RegExp.prototype.toString.js5
1 files changed, 5 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
new file mode 100644
index 0000000000..5185fcc036
--- /dev/null
+++ b/Libraries/LibJS/Tests/builtins/RegExp/RegExp.prototype.toString.js
@@ -0,0 +1,5 @@
+test("basic functionality", () => {
+ expect(RegExp.prototype.toString).toHaveLength(0);
+
+ expect(/test/g.toString()).toBe("/test/g");
+});