TypeScript/tests/baselines/reference/classExtendingNonConstructor.js
2015-06-17 14:17:52 -07:00

76 lines
1.7 KiB
TypeScript

//// [classExtendingNonConstructor.ts]
var x: {};
function foo() {
this.x = 1;
}
class C1 extends undefined { }
class C2 extends true { }
class C3 extends false { }
class C4 extends 42 { }
class C5 extends "hello" { }
class C6 extends x { }
class C7 extends foo { }
//// [classExtendingNonConstructor.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 x;
function foo() {
this.x = 1;
}
var C1 = (function (_super) {
__extends(C1, _super);
function C1() {
_super.apply(this, arguments);
}
return C1;
})(undefined);
var C2 = (function (_super) {
__extends(C2, _super);
function C2() {
_super.apply(this, arguments);
}
return C2;
})(true);
var C3 = (function (_super) {
__extends(C3, _super);
function C3() {
_super.apply(this, arguments);
}
return C3;
})(false);
var C4 = (function (_super) {
__extends(C4, _super);
function C4() {
_super.apply(this, arguments);
}
return C4;
})(42);
var C5 = (function (_super) {
__extends(C5, _super);
function C5() {
_super.apply(this, arguments);
}
return C5;
})("hello");
var C6 = (function (_super) {
__extends(C6, _super);
function C6() {
_super.apply(this, arguments);
}
return C6;
})(x);
var C7 = (function (_super) {
__extends(C7, _super);
function C7() {
_super.apply(this, arguments);
}
return C7;
})(foo);