Skip to content

Commit 6ce411d

Browse files
committed
Added tests
1 parent 703dcee commit 6ce411d

3 files changed

Lines changed: 115 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// @target: ES5
2+
// no errors
3+
4+
class C {
5+
private x: string;
6+
private get y() { return this.x; }
7+
private set y(x) { this.y = this.x; }
8+
private foo() { return this.foo; }
9+
10+
private static x: string;
11+
private static get y() { return this.x; }
12+
private static set y(x) { this.y = this.x; }
13+
private static foo() { return this.foo; }
14+
private static bar() { this.foo(); }
15+
16+
private bar() {
17+
class C2 {
18+
private foo() {
19+
let x: C;
20+
var x1 = x.foo;
21+
var x2 = x.bar;
22+
var x3 = x.x;
23+
var x4 = x.y;
24+
25+
var sx1 = C.x;
26+
var sx2 = C.y;
27+
var sx3 = C.bar;
28+
var sx4 = C.foo;
29+
30+
let y = new C();
31+
var y1 = y.foo;
32+
var y2 = y.bar;
33+
var y3 = y.x;
34+
var y4 = y.y;
35+
}
36+
}
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// @target: ES5
2+
// no errors
3+
4+
class C {
5+
protected x: string;
6+
protected get y() { return this.x; }
7+
protected set y(x) { this.y = this.x; }
8+
protected foo() { return this.foo; }
9+
10+
protected static x: string;
11+
protected static get y() { return this.x; }
12+
protected static set y(x) { this.y = this.x; }
13+
protected static foo() { return this.foo; }
14+
protected static bar() { this.foo(); }
15+
16+
protected bar() {
17+
class C2 {
18+
protected foo() {
19+
let x: C;
20+
var x1 = x.foo;
21+
var x2 = x.bar;
22+
var x3 = x.x;
23+
var x4 = x.y;
24+
25+
var sx1 = C.x;
26+
var sx2 = C.y;
27+
var sx3 = C.bar;
28+
var sx4 = C.foo;
29+
30+
let y = new C();
31+
var y1 = y.foo;
32+
var y2 = y.bar;
33+
var y3 = y.x;
34+
var y4 = y.y;
35+
}
36+
}
37+
}
38+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// @target: ES5
2+
3+
class B {
4+
protected x: string;
5+
protected static x: string;
6+
}
7+
8+
class C extends B {
9+
protected get y() { return this.x; }
10+
protected set y(x) { this.y = this.x; }
11+
protected foo() { return this.x; }
12+
13+
protected static get y() { return this.x; }
14+
protected static set y(x) { this.y = this.x; }
15+
protected static foo() { return this.x; }
16+
protected static bar() { this.foo(); }
17+
18+
protected bar() {
19+
class D {
20+
protected foo() {
21+
var c = new C();
22+
var c1 = c.y;
23+
var c2 = c.x;
24+
var c3 = c.foo;
25+
var c4 = c.bar;
26+
var c5 = c.z; // error
27+
28+
var sc1 = C.x;
29+
var sc2 = C.y;
30+
var sc3 = C.foo;
31+
var sc4 = C.bar;
32+
}
33+
}
34+
}
35+
}
36+
37+
class E extends C {
38+
protected z: string;
39+
}

0 commit comments

Comments
 (0)