Skip to content

fix(processor): preserve existing comment as fallback for accessor signatures#87

Closed
udayreddy-s wants to merge 2 commits into
webpack:mainfrom
udayreddy-s:patch-4
Closed

fix(processor): preserve existing comment as fallback for accessor signatures#87
udayreddy-s wants to merge 2 commits into
webpack:mainfrom
udayreddy-s:patch-4

Conversation

@udayreddy-s
Copy link
Copy Markdown

Summary

When resolving accessor types in processor.mjs, the existing
comment on the accessor was being unconditionally overwritten
by the signature comment — even when the signature comment
was undefined or empty.

This PR uses nullish coalescing (??) to fall back to the
existing accessor.comment when the signature comment is
missing, preserving any previously set comment.

This is a minimal, targeted improvement that avoids adding
unnecessary optional chaining on getSignature or
setSignature themselves — since as noted in #71, these
will always be defined when the reflection kind is Accessor.

Relates to: #71

What kind of change does this PR introduce?
Bug fix — prevents accidental comment loss during
accessor type resolution

Did you add tests for your changes?
No

Does this PR introduce a breaking change?
No

Use of AI
No AI was used for this change

fix(processor): preserve existing comment as fallback for accessor signatures
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-doc-kit Ready Ready Preview, Comment Apr 23, 2026 3:56am

Request Review

@udayreddy-s
Copy link
Copy Markdown
Author

Closing this — after reviewing PR #71 more carefully, I realized this overlaps with the nullish coalescing improvement already proposed there. Apologies for the duplicate.

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 this pull request may close these issues.

1 participant