Update baselines

add baselines

Update baseline
This commit is contained in:
Kanchalai Tanglertsampan
2016-02-02 16:32:10 -08:00
parent a5cf7c12bc
commit 76b6bff3d7
19 changed files with 518 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
tests/cases/conformance/classes/superCallBeforeThisAccessing1.ts(11,17): error TS2304: Cannot find name 'Factory'.
==== tests/cases/conformance/classes/superCallBeforeThisAccessing1.ts (1 errors) ====
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
super(i);
var s = {
t: this._t
}
var i = Factory.create(s);
~~~~~~~
!!! error TS2304: Cannot find name 'Factory'.
}
}

View File

@@ -0,0 +1,38 @@
//// [superCallBeforeThisAccessing1.ts]
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
super(i);
var s = {
t: this._t
}
var i = Factory.create(s);
}
}
//// [superCallBeforeThisAccessing1.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Base = (function () {
function Base(c) {
}
return Base;
}());
var D = (function (_super) {
__extends(D, _super);
function D() {
_super.call(this, i);
var s = {
t: this._t
};
var i = Factory.create(s);
}
return D;
}(Base));

View File

@@ -0,0 +1,31 @@
//// [superCallBeforeThisAccessing2.ts]
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
}
}
//// [superCallBeforeThisAccessing2.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Base = (function () {
function Base(c) {
}
return Base;
}());
var D = (function (_super) {
__extends(D, _super);
function D() {
var _this = this;
_super.call(this, function () { _this._t; }); // no error. only check when this is directly accessing in constructor
}
return D;
}(Base));

View File

@@ -0,0 +1,23 @@
=== tests/cases/conformance/classes/superCallBeforeThisAccessing2.ts ===
class Base {
>Base : Symbol(Base, Decl(superCallBeforeThisAccessing2.ts, 0, 0))
constructor(c) { }
>c : Symbol(c, Decl(superCallBeforeThisAccessing2.ts, 1, 16))
}
class D extends Base {
>D : Symbol(D, Decl(superCallBeforeThisAccessing2.ts, 2, 1))
>Base : Symbol(Base, Decl(superCallBeforeThisAccessing2.ts, 0, 0))
private _t;
>_t : Symbol(_t, Decl(superCallBeforeThisAccessing2.ts, 3, 22))
constructor() {
super(() => { this._t }); // no error. only check when this is directly accessing in constructor
>super : Symbol(Base, Decl(superCallBeforeThisAccessing2.ts, 0, 0))
>this._t : Symbol(_t, Decl(superCallBeforeThisAccessing2.ts, 3, 22))
>this : Symbol(D, Decl(superCallBeforeThisAccessing2.ts, 2, 1))
>_t : Symbol(_t, Decl(superCallBeforeThisAccessing2.ts, 3, 22))
}
}

View File

@@ -0,0 +1,25 @@
=== tests/cases/conformance/classes/superCallBeforeThisAccessing2.ts ===
class Base {
>Base : Base
constructor(c) { }
>c : any
}
class D extends Base {
>D : D
>Base : Base
private _t;
>_t : any
constructor() {
super(() => { this._t }); // no error. only check when this is directly accessing in constructor
>super(() => { this._t }) : void
>super : typeof Base
>() => { this._t } : () => void
>this._t : any
>this : this
>_t : any
}
}

View File

@@ -0,0 +1,19 @@
tests/cases/conformance/classes/superCallBeforeThisAccessing3.ts(9,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
==== tests/cases/conformance/classes/superCallBeforeThisAccessing3.ts (1 errors) ====
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
~~~~
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
super(undefined);
}
}

View File

@@ -0,0 +1,37 @@
//// [superCallBeforeThisAccessing3.ts]
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);
}
}
//// [superCallBeforeThisAccessing3.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Base = (function () {
function Base(c) {
}
return Base;
}());
var D = (function (_super) {
__extends(D, _super);
function D() {
var _this = this;
var x = function () { _this._t; };
x(); // no error; we only check super is called before this when the container is a constructor
this._t; // error
_super.call(this, undefined);
}
return D;
}(Base));

View File

@@ -0,0 +1,30 @@
tests/cases/conformance/classes/superCallBeforeThisAccessing4.ts(3,5): error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'
tests/cases/conformance/classes/superCallBeforeThisAccessing4.ts(11,5): error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'
==== tests/cases/conformance/classes/superCallBeforeThisAccessing4.ts (2 errors) ====
class D extends null {
private _t;
constructor() {
~~~~~~~~~~~~~~~
this._t;
~~~~~~~~~~~~~~~~
super();
~~~~~~~~~~~~~~~~
}
~~~~~
!!! error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'
}
class E extends null {
private _t;
constructor() {
~~~~~~~~~~~~~~~
super();
~~~~~~~~~~~~~~~~
this._t;
~~~~~~~~~~~~~~~~
}
~~~~~
!!! error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'
}

View File

@@ -0,0 +1,39 @@
//// [superCallBeforeThisAccessing4.ts]
class D extends null {
private _t;
constructor() {
this._t;
super();
}
}
class E extends null {
private _t;
constructor() {
super();
this._t;
}
}
//// [superCallBeforeThisAccessing4.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var D = (function (_super) {
__extends(D, _super);
function D() {
this._t;
_super.call(this);
}
return D;
}(null));
var E = (function (_super) {
__extends(E, _super);
function E() {
_super.call(this);
this._t;
}
return E;
}(null));

View File

@@ -0,0 +1,22 @@
//// [superCallBeforeThisAccessing5.ts]
class D extends null {
private _t;
constructor() {
this._t; // No error
}
}
//// [superCallBeforeThisAccessing5.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var D = (function (_super) {
__extends(D, _super);
function D() {
this._t; // No error
}
return D;
}(null));

View File

@@ -0,0 +1,15 @@
=== tests/cases/conformance/classes/superCallBeforeThisAccessing5.ts ===
class D extends null {
>D : Symbol(D, Decl(superCallBeforeThisAccessing5.ts, 0, 0))
private _t;
>_t : Symbol(_t, Decl(superCallBeforeThisAccessing5.ts, 0, 22))
constructor() {
this._t; // No error
>this._t : Symbol(_t, Decl(superCallBeforeThisAccessing5.ts, 0, 22))
>this : Symbol(D, Decl(superCallBeforeThisAccessing5.ts, 0, 0))
>_t : Symbol(_t, Decl(superCallBeforeThisAccessing5.ts, 0, 22))
}
}

View File

@@ -0,0 +1,16 @@
=== tests/cases/conformance/classes/superCallBeforeThisAccessing5.ts ===
class D extends null {
>D : D
>null : null
private _t;
>_t : any
constructor() {
this._t; // No error
>this._t : any
>this : this
>_t : any
}
}

View File

@@ -0,0 +1,16 @@
tests/cases/conformance/classes/superCallBeforeThisAccessing6.ts(7,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
==== tests/cases/conformance/classes/superCallBeforeThisAccessing6.ts (1 errors) ====
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
super(this);
~~~~
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
}
}

View File

@@ -0,0 +1,30 @@
//// [superCallBeforeThisAccessing6.ts]
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
super(this);
}
}
//// [superCallBeforeThisAccessing6.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Base = (function () {
function Base(c) {
}
return Base;
}());
var D = (function (_super) {
__extends(D, _super);
function D() {
_super.call(this, this);
}
return D;
}(Base));

View File

@@ -0,0 +1,19 @@
tests/cases/conformance/classes/superCallBeforeThisAccessing7.ts(8,16): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
==== tests/cases/conformance/classes/superCallBeforeThisAccessing7.ts (1 errors) ====
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
let x = {
j: this._t,
~~~~
!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
}
super(undefined);
}
}

View File

@@ -0,0 +1,36 @@
//// [superCallBeforeThisAccessing7.ts]
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
let x = {
j: this._t,
}
super(undefined);
}
}
//// [superCallBeforeThisAccessing7.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Base = (function () {
function Base(c) {
}
return Base;
}());
var D = (function (_super) {
__extends(D, _super);
function D() {
var x = {
j: this._t
};
_super.call(this, undefined);
}
return D;
}(Base));

View File

@@ -0,0 +1,36 @@
//// [superCallBeforeThisAccessing8.ts]
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
let x = {
k: super(undefined),
j: this._t, // no error
}
}
}
//// [superCallBeforeThisAccessing8.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Base = (function () {
function Base(c) {
}
return Base;
}());
var D = (function (_super) {
__extends(D, _super);
function D() {
var x = {
k: _super.call(this, undefined),
j: this._t
};
}
return D;
}(Base));

View File

@@ -0,0 +1,32 @@
=== tests/cases/conformance/classes/superCallBeforeThisAccessing8.ts ===
class Base {
>Base : Symbol(Base, Decl(superCallBeforeThisAccessing8.ts, 0, 0))
constructor(c) { }
>c : Symbol(c, Decl(superCallBeforeThisAccessing8.ts, 1, 16))
}
class D extends Base {
>D : Symbol(D, Decl(superCallBeforeThisAccessing8.ts, 2, 1))
>Base : Symbol(Base, Decl(superCallBeforeThisAccessing8.ts, 0, 0))
private _t;
>_t : Symbol(_t, Decl(superCallBeforeThisAccessing8.ts, 3, 22))
constructor() {
let x = {
>x : Symbol(x, Decl(superCallBeforeThisAccessing8.ts, 6, 11))
k: super(undefined),
>k : Symbol(k, Decl(superCallBeforeThisAccessing8.ts, 6, 17))
>super : Symbol(Base, Decl(superCallBeforeThisAccessing8.ts, 0, 0))
>undefined : Symbol(undefined)
j: this._t, // no error
>j : Symbol(j, Decl(superCallBeforeThisAccessing8.ts, 7, 32))
>this._t : Symbol(_t, Decl(superCallBeforeThisAccessing8.ts, 3, 22))
>this : Symbol(D, Decl(superCallBeforeThisAccessing8.ts, 2, 1))
>_t : Symbol(_t, Decl(superCallBeforeThisAccessing8.ts, 3, 22))
}
}
}

View File

@@ -0,0 +1,34 @@
=== tests/cases/conformance/classes/superCallBeforeThisAccessing8.ts ===
class Base {
>Base : Base
constructor(c) { }
>c : any
}
class D extends Base {
>D : D
>Base : Base
private _t;
>_t : any
constructor() {
let x = {
>x : { k: void; j: any; }
>{ k: super(undefined), j: this._t, // no error } : { k: void; j: any; }
k: super(undefined),
>k : void
>super(undefined) : void
>super : typeof Base
>undefined : undefined
j: this._t, // no error
>j : any
>this._t : any
>this : this
>_t : any
}
}
}