TypeScript Version: 3.9.1-rc, 4.0.0-dev
Search Terms: jsdoc comment parameter property modifier constructor public private protected readonly
Code
// @allowJS: true // @checkJS: true // @out: output.js // @target: esnext // @filename: input.js class C { constructor(/** @public */ y) { } }
Expected behavior:
The emit should be be the following:
class C { constructor(/** @public */ y) { } }
Actual behavior:
The emit includes a this property assignment as if the above declaration was a TypeScript parameter property:
this
class C { constructor(/** @public */ y) { this.y = y; } }
Playground Link: NOTE: Cannot repro in the playground as the playground does not support JS output when using JS as the input language
I have a fix for this that I will be posting shortly in my nodeFactory branch as part of #35282, but we may want to address this sooner during RC.
nodeFactory
/cc Daniel Rosenwasser (@DanielRosenwasser), Ryan Cavanaugh (@RyanCavanaugh)
Activity
rbuckton commentedon May 7, 2020
I have a fix for this that I will be posting shortly in my
nodeFactorybranch as part of #35282, but we may want to address this sooner during RC./cc Daniel Rosenwasser (@DanielRosenwasser), Ryan Cavanaugh (@RyanCavanaugh)