Skip to content

Use ensureModifierFlags to calculate jsdoc constructor property modifiers - #64696

Merged
Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
weswigham:jsdoc-constructor-jsdoc-modifiers
Oct 12, 2026
Merged

Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
weswigham:jsdoc-constructor-jsdoc-modifiers

Conversation

@weswigham

Copy link
Copy Markdown
Member

Fixes #64628

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The targeted fix is consistent with declaration modifier handling and has focused regression coverage.

0 open findings

What changed in this PR

Fixes JSDoc visibility and readonly modifiers for JavaScript properties inferred from this assignments.

Changes:

  • Derives declaration modifiers via ensureModifierFlags.
  • Preserves static modifiers.
  • Adds regression coverage and updates affected baselines.
File Description
tsc/​internal/​transformers/​declarations/​transform.go Preserves JSDoc modifiers during declaration emit.
tsc/​testdata/​tests/​cases/​compiler/​jsDeclarationEmitThisPropertyJSDocModifiers.ts Tests instance and static properties.
tsc/​testdata/​baselines/​reference/​compiler/​jsDeclarationEmitThisPropertyJSDocModifiers.js Records expected declarations.
tsc/​testdata/​baselines/​reference/​conformance/​jsdocReadonlyDeclarations.js Updates readonly output.
tsc/​testdata/​baselines/​reference/​conformance/​jsdocAccessibilityTagsDeclarations.js Updates accessibility output.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@hkleungai

Copy link
Copy Markdown

Curious question: will this PR affect microsoft/typescript-go#3665 too? Since it is previously closed as wont-fix, I suppose the example code there is not included in ts repo's test cases, hence the CI check may have missed something. 🤔

@jakebailey

Copy link
Copy Markdown
Member

I would assume none? You're asking for the old override behavior back, but this just fixes an emit bug?

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Oct 9, 2026
@weswigham
Wesley Wigham (weswigham) added this pull request to the merge queue Oct 12, 2026
Merged via the queue into microsoft:main with commit 5b3a367 Oct 12, 2026
29 checks passed
@weswigham
Wesley Wigham (weswigham) deleted the jsdoc-constructor-jsdoc-modifiers branch October 12, 2026 17:30
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

JSDoc @private / @protected are dropped in declaration emit for properties declared by constructor assignment

4 participants