Accepted baselines.

This commit is contained in:
Daniel Rosenwasser 2016-09-19 18:05:34 +03:00
parent da29813204
commit 60bcd7e0d0
2 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,25 @@
tests/cases/compiler/underscoreThisInDerivedClass02.ts(14,5): error TS2377: Constructors for derived classes must contain a 'super' call.
==== tests/cases/compiler/underscoreThisInDerivedClass02.ts (1 errors) ====
// @target es5
// Original test intent:
// Errors on '_this' should be reported in derived constructors,
// even if 'super()' is not called.
class C {
constructor() {
return {};
}
}
class D extends C {
constructor() {
~~~~~~~~~~~~~~~
var _this = "uh-oh?";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}
~~~~~
!!! error TS2377: Constructors for derived classes must contain a 'super' call.
}

View File

@ -0,0 +1,44 @@
//// [underscoreThisInDerivedClass02.ts]
// @target es5
// Original test intent:
// Errors on '_this' should be reported in derived constructors,
// even if 'super()' is not called.
class C {
constructor() {
return {};
}
}
class D extends C {
constructor() {
var _this = "uh-oh?";
}
}
//// [underscoreThisInDerivedClass02.js]
// @target es5
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 __());
};
// Original test intent:
// Errors on '_this' should be reported in derived constructors,
// even if 'super()' is not called.
var C = (function () {
function C() {
return {};
}
return C;
}());
var D = (function (_super) {
__extends(D, _super);
function D() {
var _this;
var _this = "uh-oh?";
return _this;
}
return D;
}(C));