TypeScript/tests/cases/conformance/jsdoc/jsdocReadonlyDeclarations.ts

26 lines
400 B
TypeScript
Raw Normal View History

// @allowJs: true
// @checkJs: true
// @target: esnext
// @out: foo.js
// @declaration: true
// @Filename: jsdocReadonlyDeclarations.js
class C {
/** @readonly */
x = 6
/** @readonly */
constructor(n) {
this.x = n
/**
* @readonly
* @type {number}
*/
this.y = n
}
}
new C().x
function F() {
/** @readonly */
this.z = 1
}