TypeScript/tests/baselines/reference/thisTag1.types
Nathan Shively-Sanders 2a8c4d1bd7
Support @this tags (#24927)
* Type check `@this` tags

No special support in fourslash yet, so quickinfo probably doesn't work.

* Do no require braces and update API baselines
2018-06-13 10:11:12 -07:00

38 lines
785 B
Plaintext

=== tests/cases/conformance/jsdoc/a.js ===
/** @this {{ n: number }} Mount Holyoke Preparatory School
* @param {string} s
* @return {number}
*/
function f(s) {
>f : (s: string) => number
>s : string
return this.n + s.length
>this.n + s.length : number
>this.n : number
>this : { n: number; }
>n : number
>s.length : number
>s : string
>length : number
}
const o = {
>o : { [x: string]: any; f: (s: string) => number; n: number; }
>{ f, n: 1} : { [x: string]: any; f: (s: string) => number; n: number; }
f,
>f : (s: string) => number
n: 1
>n : number
>1 : 1
}
o.f('hi')
>o.f('hi') : number
>o.f : (s: string) => number
>o : { [x: string]: any; f: (s: string) => number; n: number; }
>f : (s: string) => number
>'hi' : "hi"