2015-03-25 01:00:29 +01:00
|
|
|
//// [decoratorOnClassAccessor5.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 public set accessor(value: number) { }
|
2015-03-25 01:00:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//// [decoratorOnClassAccessor5.js]
|
|
|
|
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-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
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
}
|
|
|
|
Object.defineProperty(C.prototype, "accessor", {
|
2015-03-26 21:46:35 +01:00
|
|
|
set: function (value) { },
|
2015-03-25 01:00:29 +01:00
|
|
|
enumerable: true,
|
|
|
|
configurable: true
|
|
|
|
});
|
2015-03-18 01:09:39 +01:00
|
|
|
Object.defineProperty(C.prototype, "accessor", __decorate([dec, __metadata('design:type', Number), __metadata('design:paramtypes', [Number])], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor")));
|
2015-03-25 01:00:29 +01:00
|
|
|
return C;
|
|
|
|
})();
|