TypeScript/tests/baselines/reference/decoratorOnClassMethod12.js

47 lines
1.7 KiB
TypeScript
Raw Normal View History

2015-04-08 02:43:10 +02:00
//// [decoratorOnClassMethod12.ts]
module M {
class S {
decorator(target: Object, key: string): void { }
}
class C extends S {
@super.decorator
method() { }
}
}
//// [decoratorOnClassMethod12.js]
2015-05-01 19:49:54 +02:00
var __extends = (this && this.__extends) || function (d, b) {
2015-04-08 02:43:10 +02:00
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
2015-06-16 21:18:31 +02:00
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2015-04-08 02:43:10 +02:00
};
2015-05-01 19:49:54 +02:00
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
2015-04-08 02:43:10 +02:00
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var M;
(function (M) {
var S = (function () {
function S() {
}
S.prototype.decorator = function (target, key) { };
return S;
})();
var C = (function (_super) {
__extends(C, _super);
function C() {
_super.apply(this, arguments);
}
C.prototype.method = function () { };
Object.defineProperty(C.prototype, "method",
__decorate([
_super.decorator
], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method")));
return C;
})(S);
})(M || (M = {}));