mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 10:55:15 -06:00
Accepted baselines.
This commit is contained in:
parent
da29813204
commit
60bcd7e0d0
@ -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.
|
||||
}
|
||||
44
tests/baselines/reference/underscoreThisInDerivedClass02.js
Normal file
44
tests/baselines/reference/underscoreThisInDerivedClass02.js
Normal 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));
|
||||
Loading…
x
Reference in New Issue
Block a user