TypeScript/tests/baselines/reference/decoratorOnClassProperty2.js

23 lines
894 B
TypeScript
Raw Normal View History

2015-03-25 01:00:29 +01:00
//// [decoratorOnClassProperty2.ts]
declare function dec(target: any, propertyKey: string): void;
2015-03-17 22:06:06 +01:00
class C {
@dec public prop;
2015-03-25 01:00:29 +01:00
}
//// [decoratorOnClassProperty2.js]
2015-05-01 19:49:54 +02:00
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2015-09-11 19:23:03 +02:00
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
2015-03-25 01:00:29 +01:00
};
var C = (function () {
function C() {
}
__decorate([
dec
2015-09-11 19:23:03 +02:00
], C.prototype, "prop", void 0);
2015-03-25 01:00:29 +01:00
return C;
}());