* Type check `@this` tags No special support in fourslash yet, so quickinfo probably doesn't work. * Do no require braces and update API baselines
38 lines
785 B
Plaintext
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"
|
|
|