swc/crates/swc_ecma_parser/tests/tsc/jsdocReadonlyDeclarations.ts
2022-02-04 17:08:38 +09:00

31 lines
542 B
TypeScript

// @allowJs: true
// @checkJs: true
// @target: esnext
// @out: foo.js
// @declaration: true
// @Filename: jsdocReadonlyDeclarations.js
// @useDefineForClassFields: false
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
}
// https://github.com/microsoft/TypeScript/issues/38401
class D {
constructor(/** @readonly */ x) {}
}