Skip to content

Commit a5cf7c1

Browse files
author
Kanchalai Tanglertsampan
committed
add conformance tests
1 parent 6975e44 commit a5cf7c1

8 files changed

+88
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Base {
2+
constructor(c) { }
3+
}
4+
class D extends Base {
5+
private _t;
6+
constructor() {
7+
super(i);
8+
var s = {
9+
t: this._t
10+
}
11+
var i = Factory.create(s);
12+
}
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Base {
2+
constructor(c) { }
3+
}
4+
class D extends Base {
5+
private _t;
6+
constructor() {
7+
super(() => { this._t }); // no error. only check when this is directly accessing in constructor
8+
}
9+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Base {
2+
constructor(c) { }
3+
}
4+
class D extends Base {
5+
private _t;
6+
constructor() {
7+
let x = () => { this._t };
8+
x(); // no error; we only check super is called before this when the container is a constructor
9+
this._t; // error
10+
super(undefined);
11+
}
12+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class D extends null {
2+
private _t;
3+
constructor() {
4+
this._t;
5+
super();
6+
}
7+
}
8+
9+
class E extends null {
10+
private _t;
11+
constructor() {
12+
super();
13+
this._t;
14+
}
15+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class D extends null {
2+
private _t;
3+
constructor() {
4+
this._t; // No error
5+
}
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Base {
2+
constructor(c) { }
3+
}
4+
class D extends Base {
5+
private _t;
6+
constructor() {
7+
super(this);
8+
}
9+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Base {
2+
constructor(c) { }
3+
}
4+
class D extends Base {
5+
private _t;
6+
constructor() {
7+
let x = {
8+
j: this._t,
9+
}
10+
super(undefined);
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Base {
2+
constructor(c) { }
3+
}
4+
class D extends Base {
5+
private _t;
6+
constructor() {
7+
let x = {
8+
k: super(undefined),
9+
j: this._t, // no error
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)