|
| 1 | +//// [tests/cases/conformance/decorators/decoratorMetadata.ts] //// |
| 2 | + |
| 3 | +//// [service.ts] |
| 4 | +export default class Service { |
| 5 | +} |
| 6 | +//// [component.ts] |
| 7 | +import Service from "./service"; |
| 8 | + |
| 9 | +declare var decorator: any; |
| 10 | + |
| 11 | +@decorator |
| 12 | +class MyComponent { |
| 13 | + constructor(public Service: Service) { |
| 14 | + } |
| 15 | +} |
| 16 | + |
| 17 | +//// [service.js] |
| 18 | +var Service = (function () { |
| 19 | + function Service() { |
| 20 | + } |
| 21 | + return Service; |
| 22 | +})(); |
| 23 | +Object.defineProperty(exports, "__esModule", { value: true }); |
| 24 | +exports.default = Service; |
| 25 | +//// [component.js] |
| 26 | +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
| 27 | + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); |
| 28 | + switch (arguments.length) { |
| 29 | + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); |
| 30 | + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); |
| 31 | + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); |
| 32 | + } |
| 33 | +}; |
| 34 | +var __metadata = (this && this.__metadata) || function (k, v) { |
| 35 | + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
| 36 | +}; |
| 37 | +var MyComponent = (function () { |
| 38 | + function MyComponent(Service) { |
| 39 | + this.Service = Service; |
| 40 | + } |
| 41 | + MyComponent = __decorate([ |
| 42 | + decorator, |
| 43 | + __metadata('design:paramtypes', [service_1.default]) |
| 44 | + ], MyComponent); |
| 45 | + return MyComponent; |
| 46 | +})(); |
0 commit comments