lib: document remaining ProxyHandler trap parameters - #63738
Open
Yogesh Kumar (yogesh968) wants to merge 1 commit into
Open
lib: document remaining ProxyHandler trap parameters#63738Yogesh Kumar (yogesh968) wants to merge 1 commit into
Yogesh Kumar (yogesh968) wants to merge 1 commit into
Conversation
Several ProxyHandler traps document `target` and then stop, leaving the rest of their parameters with no description in hover and signature help: `apply` is missing `thisArg` and `argArray`, `construct` skips `argArray`, `defineProperty` is missing `property` and `attributes`, and `set` skips `newValue`. `setPrototypeOf` has the same symptom for a different reason: it documents `@param newPrototype` while the parameter is named `v`, so the tag matches nothing and the description is dropped. Rename the parameter to `newPrototype` to match both the existing tag and the sibling `set` trap, which already spells its value parameter `newValue` rather than the spec's `V`.
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
1 similar comment
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
ProxyHandlerdocumentstargeton every trap, but several traps stop there and leavetheir remaining parameters undocumented, so hovering them in an editor shows a parameter
list with no descriptions attached. One trap documents a parameter that does not exist.
applythisArgandargArrayundocumentedconstructargArrayundocumented (targetandnewTargetare documented, so it is skipped in the middle)definePropertypropertyandattributesundocumentedsetnewValueundocumented (target,pandreceiverare documented)setPrototypeOf@param newPrototype, but the parameter is namedvThe
setPrototypeOfone is the reason the others are worth fixing together: because theJSDoc name does not match the parameter, the description is dropped on the floor and the
parameter shows up bare, exactly like the undocumented ones.
For that trap I renamed the parameter
v→newPrototyperather than renaming the tag,for two reasons. The neighbouring
settrap already spells its value parameternewValueinstead of the spec'sV, sonewPrototypeis what matches the surroundingfile; and the existing JSDoc shows
newPrototypewas the intended name. This follows#63504, which renamed
maxLength/fillStringtotargetLength/padStringfor the samekind of mismatch. Parameter names in a
.d.tsdo not participate in assignability, sothis does not change what type-checks — it changes the name shown in completions and
signature help.
The added descriptions follow the wording already used by the sibling traps in this file
(
The name orSymbolof the property to ...).Testing
npx hereby runtests-parallel— 106,369 passing, no baseline changes from this PR.(The full run was done with this change alongside three other lib JSDoc fixes I am
sending separately; the only baselines it moved belong to the
[Symbol.matchAll]parameter rename in that other PR, not to this one.)
Disclosure
This patch was authored with AI assistance (Claude Code). I chose the change, reviewed the
diff, ran the tests locally, and will be the one responding to review feedback.