TypeScript/tests/baselines/reference/jsdocReadonlyDeclarations.js
Ron Buckton d07e866a28
Fix for jsdoc modifiers on constructor params (#38403)
* Fix for jsdoc modifiers on constructor params

* Update Public API baseline and fix unique symbol grammar check for js
2020-05-11 15:07:43 -07:00

72 lines
1.2 KiB
TypeScript

//// [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
}
// https://github.com/microsoft/TypeScript/issues/38401
class D {
constructor(/** @readonly */ x) {}
}
//// [foo.js]
class C {
/** @readonly */
constructor(n) {
/** @readonly */
this.x = 6;
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) { }
}
//// [foo.d.ts]
declare function F(): void;
declare class F {
/** @readonly */
readonly z: number;
}
declare class C {
/** @readonly */
constructor(n: any);
/** @readonly */
readonly x: 6;
/**
* @readonly
* @type {number}
*/
readonly y: number;
}
declare class D {
constructor(x: any);
}