Skip to content

lib: fix two Reflect JSDoc defects - #63740

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

lib: fix two Reflect JSDoc defects#63740
Yogesh Kumar (yogesh968) wants to merge 1 commit into
microsoft:mainfrom
yogesh968:lib-reflect-jsdoc

Conversation

@yogesh968

Copy link
Copy Markdown

Two small documentation defects in lib.es2015.reflect.d.ts:

Reflect.set does not document value. The block documents target, propertyKey
and receiver — everything except the value being assigned, which is skipped in the
middle of the list:

/**
 * @param target Object that contains the property on itself or in its prototype chain.
 * @param propertyKey Name of the property.
 * @param receiver The reference to use as the `this` value in the setter function, ...
 */
function set<T extends object, P extends PropertyKey>(
    target: T,
    propertyKey: P,
    value: P extends keyof T ? T[P] : any,   // <- undocumented
    receiver?: any,
): boolean;

Reflect.setPrototypeOf's summary refers to parameters that do not exist. It reads
"Sets the prototype of a specified object o to object proto or null", but the parameters
are named target and proto — there is no o. The wording looks inherited from
Object.setPrototypeOf(o, proto) in lib.es5.d.ts, which does have an o. Renamed the
reference to target and put both parameter names in backticks so they read as
identifiers.

Documentation only; no signatures changed.

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.

Reflect.set documents target, propertyKey and receiver but skips value, the one
parameter that says what is being assigned.

Reflect.setPrototypeOf's summary reads "Sets the prototype of a specified object o
to object proto or null", but this function's parameters are target and proto -
there is no o. The wording appears to have been carried over from
Object.setPrototypeOf(o, proto) in lib.es5.d.ts, which does have one.
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

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.

@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 10, 2026

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