Test for incorrect check in emitPutDerivedConstructorToArrowFunctionContextScope.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2018 17:43:27 +0000 (17:43 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2018 17:43:27 +0000 (17:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169445
<rdar://problem/30957435>

Reviewed by Saam Barati.

* stress/regress-169445.js: Added.
(let.gun.eval.A):
(let.gun.eval.B.C):
(let.gun.eval.B.C.prototype.trigger):
(let.gun.eval.B.C.prototype.triggerWithRestParameters):
(let.gun.eval.B):
(let.gun.eval):

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

JSTests/ChangeLog
JSTests/stress/regress-169445.js [new file with mode: 0644]

index e60abee..078cead 100644 (file)
@@ -1 +1,17 @@
+2018-09-11  Mark Lam  <mark.lam@apple.com>
+
+        Test for incorrect check in emitPutDerivedConstructorToArrowFunctionContextScope.
+        https://bugs.webkit.org/show_bug.cgi?id=169445
+        <rdar://problem/30957435>
+
+        Reviewed by Saam Barati.
+
+        * stress/regress-169445.js: Added.
+        (let.gun.eval.A):
+        (let.gun.eval.B.C):
+        (let.gun.eval.B.C.prototype.trigger):
+        (let.gun.eval.B.C.prototype.triggerWithRestParameters):
+        (let.gun.eval.B):
+        (let.gun.eval):
+
 == Rolled over to ChangeLog-2018-09-11 ==
diff --git a/JSTests/stress/regress-169445.js b/JSTests/stress/regress-169445.js
new file mode 100644 (file)
index 0000000..35e4556
--- /dev/null
@@ -0,0 +1,44 @@
+let args = new Array(0x10000);
+args.fill();
+args = args.map((_, i) => 'a' + i).join(', ');
+
+let gun = eval(`(function () {
+    class A {
+
+    }
+
+    class B extends A {
+        constructor(${args}) {
+            () => {
+                ${args};
+                super();
+            };
+
+            class C {
+                constructor() {
+                }
+
+                trigger() {
+                    (() => {
+                        super.x;
+                    })();
+                }
+
+                triggerWithRestParameters(...args) {
+                    (() => {
+                        super.x;
+                    })();
+                }
+            }
+
+            return new C();
+        }
+    }
+
+    return new B();
+})()`);
+
+for (let i = 0; i < 0x10000; i++) {
+    gun.trigger();
+    gun.triggerWithRestParameters(1, 2, 3);
+}