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

Issue with "Uint8Array" (and other TypedArray concrete class pages): missing inheritance from %TypedArray% #20019

Closed
Josh-Cena opened this issue Aug 27, 2022 · 4 comments · Fixed by #21746
Labels
Content:JS JavaScript docs

Comments

@Josh-Cena
Copy link
Member

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array

What specific section or headline is this issue about?

No response

What information was incorrect, unhelpful, or incomplete?

These pages mention things like Uint8Array.prototype.copyWithin(). There's no such thing—only %TypedArray%.prototype.copyWithin(). There's no need to repeat these methods on every constructor's page—just include the inheritance from %TypedArray% in the left sidebar, like we do for Web API.

What did you expect to see?

Remove the redundant mentions of typed array methods on every concrete class's page—there's only one such method in JavaScript, not one per typed array class.

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

image

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@github-actions github-actions bot added needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. Content:JS JavaScript docs labels Aug 27, 2022
@Josh-Cena Josh-Cena removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Aug 27, 2022
@Josh-Cena
Copy link
Member Author

Josh-Cena commented Aug 27, 2022

I'm pretty sure this has been brought up in the past but I can't find the thread anywhere now. Inheritance information in the JS references is incredibly unuseful—literally everything says "inherits from Function", but that's just the constructor, not the actual class. This data is also hardcoded in the KS macro. Is it possible for us to extract it to the content repo?

@ghost
Copy link

ghost commented Aug 30, 2022

Appears related to https://github.com/mdn/content/discussions/18002, but you're arguing for the sake of correctness, yes?

@Josh-Cena
Copy link
Member Author

Yes, the fact that Uint8Array.prototype.copyWithin() is mentioned at all. It should just be shown in the left sidebar as inheritance.

@ghost
Copy link

ghost commented Aug 30, 2022

Got it!

Furthermore, note that even the instance properties are accessors, implementated on %TypeArray%.prototype, so everything besides the constants and constructors, are inherited.

The constants are each loaded on the individual <ConcreteTypedArray>.prototype.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:JS JavaScript docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant