1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
//// [newTarget.es5.ts]
class A {
constructor() {
const a = new.target;
const b = () => new.target;
}
static c = function () { return new.target; }
d = function () { return new.target; }
}
class B extends A {
constructor() {
super();
const e = new.target;
const f = () => new.target;
}
}
function f1() {
const g = new.target;
const h = () => new.target;
}
const f2 = function () {
const i = new.target;
const j = () => new.target;
}
const O = {
k: function () { return new.target; }
};
//// [newTarget.es5.js]
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var A = /** @class */ (function () {
function A() {
var _newTarget = this.constructor;
this.d = function _a() {
var _newTarget = this && this instanceof _a ? this.constructor : void 0;
return _newTarget;
};
var a = _newTarget;
var b = function () { return _newTarget; };
}
A.c = function _a() {
var _newTarget = this && this instanceof _a ? this.constructor : void 0;
return _newTarget;
};
return A;
}());
var B = /** @class */ (function (_super) {
__extends(B, _super);
function B() {
var _newTarget = this.constructor;
var _this = _super.call(this) || this;
var e = _newTarget;
var f = function () { return _newTarget; };
return _this;
}
return B;
}(A));
function f1() {
var _newTarget = this && this instanceof f1 ? this.constructor : void 0;
var g = _newTarget;
var h = function () { return _newTarget; };
}
var f2 = function f2() {
var _newTarget = this && this instanceof f2 ? this.constructor : void 0;
var i = _newTarget;
var j = function () { return _newTarget; };
};
var O = {
k: function k() {
var _newTarget = this && this instanceof k ? this.constructor : void 0;
return _newTarget;
}
};
|