Skip to content

lib: document remaining ProxyHandler trap parameters - #63738

Open
Yogesh Kumar (yogesh968) wants to merge 1 commit into
microsoft:mainfrom
yogesh968:lib-proxy-handler-jsdoc
Open

lib: document remaining ProxyHandler trap parameters#63738
Yogesh Kumar (yogesh968) wants to merge 1 commit into
microsoft:mainfrom
yogesh968:lib-proxy-handler-jsdoc

Conversation

@yogesh968

Copy link
Copy Markdown

ProxyHandler documents target on every trap, but several traps stop there and leave
their 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.

Trap Problem
apply thisArg and argArray undocumented
construct argArray undocumented (target and newTarget are documented, so it is skipped in the middle)
defineProperty property and attributes undocumented
set newValue undocumented (target, p and receiver are documented)
setPrototypeOf documents @param newPrototype, but the parameter is named v

The setPrototypeOf one is the reason the others are worth fixing together: because the
JSDoc 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 vnewPrototype rather than renaming the tag,
for two reasons. The neighbouring set trap already spells its value parameter
newValue instead of the spec's V, so newPrototype is what matches the surrounding
file; and the existing JSDoc shows newPrototype was the intended name. This follows
#63504, which renamed maxLength/fillString to targetLength/padString for the same
kind of mismatch. Parameter names in a .d.ts do not participate in assignability, so
this 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 or Symbol of 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.

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`.
Copilot AI lite review requested due to automatic review settings August 10, 2026 07:30
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Aug 10, 2026
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 10, 2026
@typescript-automation

Copy link
Copy Markdown

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
@typescript-automation

Copy link
Copy Markdown

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

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.

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.

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

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

3 participants