mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-02 14:48:32 -05:00
Adds minimal support for 'this' types in decorator metadata, emitting 'Object' for now.
This commit is contained in:
@@ -6006,6 +6006,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
case SyntaxKind.UnionType:
|
||||
case SyntaxKind.IntersectionType:
|
||||
case SyntaxKind.AnyKeyword:
|
||||
case SyntaxKind.ThisType:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -12,6 +12,10 @@ declare var decorator: any;
|
||||
class MyComponent {
|
||||
constructor(public Service: Service) {
|
||||
}
|
||||
|
||||
@decorator
|
||||
method(x: this) {
|
||||
}
|
||||
}
|
||||
|
||||
//// [service.js]
|
||||
@@ -37,6 +41,14 @@ var MyComponent = (function () {
|
||||
function MyComponent(Service) {
|
||||
this.Service = Service;
|
||||
}
|
||||
MyComponent.prototype.method = function (x) {
|
||||
};
|
||||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', Function),
|
||||
__metadata('design:paramtypes', [Object]),
|
||||
__metadata('design:returntype', void 0)
|
||||
], MyComponent.prototype, "method", null);
|
||||
MyComponent = __decorate([
|
||||
decorator,
|
||||
__metadata('design:paramtypes', [service_1.default])
|
||||
|
||||
@@ -19,4 +19,12 @@ class MyComponent {
|
||||
>Service : Symbol(Service, Decl(component.ts, 6, 16))
|
||||
>Service : Symbol(Service, Decl(component.ts, 0, 6))
|
||||
}
|
||||
|
||||
@decorator
|
||||
>decorator : Symbol(decorator, Decl(component.ts, 2, 11))
|
||||
|
||||
method(x: this) {
|
||||
>method : Symbol(method, Decl(component.ts, 7, 5))
|
||||
>x : Symbol(x, Decl(component.ts, 10, 11))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,12 @@ class MyComponent {
|
||||
>Service : Service
|
||||
>Service : Service
|
||||
}
|
||||
|
||||
@decorator
|
||||
>decorator : any
|
||||
|
||||
method(x: this) {
|
||||
>method : (x: this) => void
|
||||
>x : this
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,8 @@ declare var decorator: any;
|
||||
class MyComponent {
|
||||
constructor(public Service: Service) {
|
||||
}
|
||||
|
||||
@decorator
|
||||
method(x: this) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user