76 lines
1.6 KiB
TypeScript
76 lines
1.6 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; }
|
|
__.prototype = b.prototype;
|
|
d.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);
|