JavaScriptCore: add test for weird class static getters
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Dec 2017 00:41:53 +0000 (00:41 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Dec 2017 00:41:53 +0000 (00:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180281
<rdar://problem/35592139>

Reviewed by Mark Lam.

I fixed a bug for it in r224927 and didn't add a test. Do so.

* stress/class-static-get-weird.js: Added.
(c.prototype.get name):
(c):
(c.prototype.get arguments):
(c.prototype.get caller):
(c.prototype.get length):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225435 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JSTests/ChangeLog
JSTests/stress/class-static-get-weird.js [new file with mode: 0644]

index 3284585..3dd0be5 100644 (file)
@@ -1,3 +1,20 @@
+2017-12-01  JF Bastien  <jfbastien@apple.com>
+
+        JavaScriptCore: add test for weird class static getters
+        https://bugs.webkit.org/show_bug.cgi?id=180281
+        <rdar://problem/35592139>
+
+        Reviewed by Mark Lam.
+
+        I fixed a bug for it in r224927 and didn't add a test. Do so.
+
+        * stress/class-static-get-weird.js: Added.
+        (c.prototype.get name):
+        (c):
+        (c.prototype.get arguments):
+        (c.prototype.get caller):
+        (c.prototype.get length):
+
 2017-12-01  Saam Barati  <sbarati@apple.com>
 
         Having a bad time needs to handle ArrayClass indexing type as well
diff --git a/JSTests/stress/class-static-get-weird.js b/JSTests/stress/class-static-get-weird.js
new file mode 100644 (file)
index 0000000..02f967e
--- /dev/null
@@ -0,0 +1,19 @@
+{
+    class c { static get name() { return 42; } }
+    if (c.name !== 42) throw "Fail";
+}
+
+{
+    class c { static get arguments() { return 42; } }
+    if (c.arguments !== 42) throw "Fail";
+}
+
+{
+    class c { static get caller() { return 42; } }
+    if (c.caller !== 42) throw "Fail";
+}
+
+{
+    class c { static get length() { return 42; } }
+    if (c.length !== 42) throw "Fail";
+}