fix: improve safety when resolving accessor types#71
Open
Divi2709 wants to merge 1 commit intowebpack:mainfrom
Open
fix: improve safety when resolving accessor types#71Divi2709 wants to merge 1 commit intowebpack:mainfrom
Divi2709 wants to merge 1 commit intowebpack:mainfrom
Conversation
|
|
avivkeller
requested changes
Mar 30, 2026
Member
avivkeller
left a comment
There was a problem hiding this comment.
Has this error ever occurred? Given the context, these will always be defined, no?
|
I looked at the processor.mjs code I think avivkeller's question is valid. Since getSignature and setSignature come from TypeDoc's Declarationreflection, they would only exist on actual accessor declarations.It might be worth checking if there is a real case in webpack's types.d.ts where this would be undefined before merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix unsafe access when resolving accessor types in processor.
Previously, accessor type resolution assumed that
getSignatureorsetSignaturewould always be defined. This could lead to runtime errors when these properties were undefined.This change adds optional chaining to safely access nested properties and preserves existing comments when signature comments are missing.
The output format remains unchanged, ensuring compatibility with doc-kit.