2015-03-23 22:47:07 +01:00
|
|
|
//// [decoratorOnClassMethod4.ts]
|
2015-03-17 22:06:06 +01:00
|
|
|
declare function dec<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
|
|
|
|
|
|
|
|
class C {
|
|
|
|
@dec ["method"]() {}
|
2015-03-23 22:47:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//// [decoratorOnClassMethod4.js]
|
2015-03-25 01:00:29 +01:00
|
|
|
var __decorate = this.__decorate || function (decorators, target, key, value) {
|
|
|
|
var kind = typeof (arguments.length == 2 ? value = target : value);
|
2015-03-23 22:47:07 +01:00
|
|
|
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
|
|
var decorator = decorators[i];
|
2015-03-25 01:00:29 +01:00
|
|
|
switch (kind) {
|
|
|
|
case "function": value = decorator(value) || value; break;
|
|
|
|
case "number": decorator(target, key, value); break;
|
|
|
|
case "undefined": decorator(target, key); break;
|
|
|
|
case "object": value = decorator(target, key, value) || value; break;
|
|
|
|
}
|
2015-03-23 22:47:07 +01:00
|
|
|
}
|
2015-03-25 01:00:29 +01:00
|
|
|
return value;
|
2015-03-23 22:47:07 +01:00
|
|
|
};
|
2015-03-26 02:12:57 +01:00
|
|
|
var __metadata = this.__metadata || (typeof Reflect === "object" && Reflect.metadata) || function () { return function() { } };
|
2015-03-25 01:00:29 +01:00
|
|
|
class C {
|
2015-03-26 21:46:35 +01:00
|
|
|
[_a = "method"]() { }
|
2015-03-25 01:00:29 +01:00
|
|
|
}
|
2015-03-18 01:09:39 +01:00
|
|
|
Object.defineProperty(C.prototype, _a, __decorate([dec, __metadata('design:type', Function), __metadata('design:paramtypes', []), __metadata('design:returntype', Object)], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a)));
|
2015-03-25 01:00:29 +01:00
|
|
|
var _a;
|