Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: JSDoc '@public' comment on constructor parameter affects JS emit #38401

Closed
rbuckton opened this issue May 7, 2020 · 1 comment · Fixed by #38403
Closed

Regression: JSDoc '@public' comment on constructor parameter affects JS emit #38401

rbuckton opened this issue May 7, 2020 · 1 comment · Fixed by #38403
Assignees

Comments

@rbuckton
Copy link
Member

rbuckton commented May 7, 2020

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:

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

@rbuckton
Copy link
Member Author

rbuckton commented May 7, 2020

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.

/cc @DanielRosenwasser, @RyanCavanaugh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant