TypeScript/tests/baselines/reference/decoratorOnClassMethodThisParameter.types
Josh Goldberg 905a1fea39
Corrected parsing for decorators on 'this' parameters (#43175)
* Corrected parsing for decorators on 'this' parameters

* Moved checking to parser and added a specific test

* Remove unrelated checker.ts blank line

* Missed some baseeline updates...
2021-04-07 11:21:28 -07:00

27 lines
871 B
Plaintext

=== tests/cases/conformance/decorators/class/method/parameter/decoratorOnClassMethodThisParameter.ts ===
declare function dec(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
>dec : (target: Object, propertyKey: string | symbol, parameterIndex: number) => void
>target : Object
>propertyKey : string | symbol
>parameterIndex : number
class C {
>C : C
method(@dec this: C) {}
>method : (this: C) => void
>dec : (target: Object, propertyKey: string | symbol, parameterIndex: number) => void
>this : C
}
class C2 {
>C2 : C2
method(@dec allowed: C2, @dec this: C2) {}
>method : (allowed: C2, this: C2) => void
>dec : (target: Object, propertyKey: string | symbol, parameterIndex: number) => void
>allowed : C2
>dec : (target: Object, propertyKey: string | symbol, parameterIndex: number) => void
>this : C2
}