]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/class-syntax-tdz-in-catch.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / class-syntax-tdz-in-catch.js
1
2 class A {
3 constructor() { }
4 }
5
6 class B extends A {
7 constructor() {
8 try {
9 this;
10 } catch (e) {
11 this;
12 super();
13 }
14 }
15 }
16
17 noInline(B);
18
19 for (var i = 0; i < 10000; ++i) {
20 var exception = null;
21 try {
22 new B(false);
23 } catch (e) {
24 exception = e;
25 if (!(e instanceof ReferenceError))
26 throw "Exception thrown in iteration " + i + " was not a reference error";
27 }
28 if (!exception)
29 throw "Exception not thrown for an unitialized this at iteration " + i;
30 }