Skip to content

Fix for jsdoc modifiers on constructor params #38403

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

Merged
merged 2 commits into from
May 11, 2020
Merged

Fix for jsdoc modifiers on constructor params #38403

merged 2 commits into from
May 11, 2020

Conversation

rbuckton
Copy link
Member

@rbuckton rbuckton commented May 7, 2020

When we added support for @public, @private, @protected, @readonly JSDoc-style modifiers, we inadvertently treated such modifiers on constructor properties as if they were TypeScript "parameter property modifiers", resulting in comments in a JS source file affecting JS emit.

This PR splits the various "modifier"-related functions into "syntactic" and "effective" forms, where "syntactic" modifiers are derived from syntax, and "effective" modifiers including both the syntactic modifiers as well as modifiers derived from "jsdoc" comments.

Fixes #38401

/cc @DanielRosenwasser, @RyanCavanaugh in case we decide to take this for 3.9.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the basic approach is a good idea. Hats off for updating every single usage.

Couple of questions and individual usage, and I think this should not go into 3.9 because our test coverage is so poor in this area; I'd like to have people use it for quite a while first.

@rbuckton
Copy link
Member Author

rbuckton commented May 8, 2020

I've updated based on feedback.

@rbuckton
Copy link
Member Author

rbuckton commented May 8, 2020

@sandersn can you take another look?

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

Successfully merging this pull request may close these issues.

Regression: JSDoc '@public' comment on constructor parameter affects JS emit
3 participants