Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflect.construct(): newTarget description incorrectly refers to the prototype of the constructor #35895

Open
ajvincent opened this issue Sep 16, 2024 · 3 comments
Labels
Content:JS JavaScript docs

Comments

@ajvincent
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/construct#newtarget

What specific section or headline is this issue about?

Parameters: newTarget

What information was incorrect, unhelpful, or incomplete?

"which usually specifies the prototype of the returned object." - this is incorrect.

What did you expect to see?

Something along the lines of "the function you called new with".

Do you have any supporting links, references, or citations?

Do you have anything more you want to share?

No response

@ajvincent ajvincent added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Sep 16, 2024
@github-actions github-actions bot added the Content:JS JavaScript docs label Sep 16, 2024
@Josh-Cena
Copy link
Member

So I think "the value of new.target" sufficiently captures all the guaranteed semantics about this parameter, and anything else after it is just us trying to be helpful and talking about what happens in the general case. Normally object creation uses new.target.prototype as the prototype so this is certainly not wrong, but I would not be opposed to changing it to your suggestion.

@Josh-Cena Josh-Cena removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Sep 16, 2024
@ajvincent
Copy link
Author

ajvincent commented Sep 16, 2024

@Josh-Cena
Copy link
Member

Feel free to send a PR btw and we can discuss the wording, but I think your suggestion looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs
2 participants