2015-03-25 08:06:38 +01:00
|
|
|
//// [decoratorOnClassAccessor6.ts]
|
2015-03-17 22:06:06 +01:00
|
|
|
declare function dec<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
|
|
|
|
|
|
|
|
class C {
|
|
|
|
public @dec set accessor(value: number) { }
|
2015-03-25 08:06:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//// [decoratorOnClassAccessor6.js]
|
2015-04-02 03:28:43 +02:00
|
|
|
var __decorate = this.__decorate || function (decorators, target, key, value) {
|
|
|
|
var kind = typeof (arguments.length == 2 ? value = target : value);
|
|
|
|
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
|
|
var decorator = decorators[i];
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return value;
|
|
|
|
};
|
2015-03-25 08:06:38 +01:00
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
}
|
2015-04-02 03:28:43 +02:00
|
|
|
Object.defineProperty(C.prototype, "accessor", {
|
|
|
|
set: function (value) { },
|
|
|
|
enumerable: true,
|
|
|
|
configurable: true
|
|
|
|
});
|
|
|
|
Object.defineProperty(C.prototype, "accessor", __decorate([dec], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
|
2015-03-25 08:06:38 +01:00
|
|
|
return C;
|
|
|
|
})();
|