add conformance tests

This commit is contained in:
Kanchalai Tanglertsampan 2016-02-02 16:31:32 -08:00
parent 6975e44346
commit a5cf7c12bc
8 changed files with 88 additions and 0 deletions

View File

@ -0,0 +1,13 @@
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
super(i);
var s = {
t: this._t
}
var i = Factory.create(s);
}
}

View File

@ -0,0 +1,9 @@
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
super(() => { this._t }); // no error. only check when this is directly accessing in constructor
}
}

View File

@ -0,0 +1,12 @@
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
let x = () => { this._t };
x(); // no error; we only check super is called before this when the container is a constructor
this._t; // error
super(undefined);
}
}

View File

@ -0,0 +1,15 @@
class D extends null {
private _t;
constructor() {
this._t;
super();
}
}
class E extends null {
private _t;
constructor() {
super();
this._t;
}
}

View File

@ -0,0 +1,6 @@
class D extends null {
private _t;
constructor() {
this._t; // No error
}
}

View File

@ -0,0 +1,9 @@
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
super(this);
}
}

View File

@ -0,0 +1,12 @@
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
let x = {
j: this._t,
}
super(undefined);
}
}

View File

@ -0,0 +1,12 @@
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
let x = {
k: super(undefined),
j: this._t, // no error
}
}
}