* Use CFA to determine types of properties declared by this.xxx assignments * Accept new baselines * Also use CFA in constructor functions * Accept new baselines * Fix lint error * Only widen fresh literal types in CFA of assignment to auto-typed * Auto-typing for declared properties with no type annotation or initializer * Add optionality if declaration includes '?' modifier * Always use CFA for properties with no initializer in .js files * Small fix
48 lines
2.1 KiB
Plaintext
48 lines
2.1 KiB
Plaintext
=== tests/cases/conformance/jsdoc/declarations/index.js ===
|
|
module.exports = class {
|
|
>module.exports = class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof import("tests/cases/conformance/jsdoc/declarations/index")
|
|
>module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index")
|
|
>module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); }
|
|
>exports : typeof import("tests/cases/conformance/jsdoc/declarations/index")
|
|
>class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof import("tests/cases/conformance/jsdoc/declarations/index")
|
|
|
|
/**
|
|
* @param {number} p
|
|
*/
|
|
constructor(p) {
|
|
>p : number
|
|
|
|
this.t = 12 + p;
|
|
>this.t = 12 + p : number
|
|
>this.t : any
|
|
>this : this
|
|
>t : any
|
|
>12 + p : number
|
|
>12 : 12
|
|
>p : number
|
|
}
|
|
}
|
|
module.exports.Sub = class {
|
|
>module.exports.Sub = class { constructor() { this.instance = new module.exports(10); }} : typeof Sub
|
|
>module.exports.Sub : typeof Sub
|
|
>module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index")
|
|
>module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); }
|
|
>exports : typeof import("tests/cases/conformance/jsdoc/declarations/index")
|
|
>Sub : typeof Sub
|
|
>class { constructor() { this.instance = new module.exports(10); }} : typeof Sub
|
|
|
|
constructor() {
|
|
this.instance = new module.exports(10);
|
|
>this.instance = new module.exports(10) : import("tests/cases/conformance/jsdoc/declarations/index")
|
|
>this.instance : any
|
|
>this : this
|
|
>instance : any
|
|
>new module.exports(10) : import("tests/cases/conformance/jsdoc/declarations/index")
|
|
>module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/index")
|
|
>module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/index"); }
|
|
>exports : typeof import("tests/cases/conformance/jsdoc/declarations/index")
|
|
>10 : 10
|
|
}
|
|
}
|
|
|