TypeScript/tests/cases/conformance/jsdoc/thisTag1.ts
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

20 lines
282 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
/** @this {{ n: number }} Mount Holyoke Preparatory School
* @param {string} s
* @return {number}
*/
function f(s) {
return this.n + s.length
}
const o = {
f,
n: 1
}
o.f('hi')