| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
I don't think we need to document inherited methods like subarray(). If anything, only the new note should be added to the description for slice(). |
Sorry, something went wrong.
Really? There are lots of methods and properties in the doc, directly inherited from Uint8Array, for example:
I think #subarray() is also a method to be known, which is compatible with Uint8Array. |
Sorry, something went wrong.
|
Right, I don't agree those need to be there either. IMO there is no need to duplicate documentation (already available at places like MDN) for those properties/methods unless there is some behavioral/semantic difference with node's implementation. Making it clear that Buffer inherits from Uint8Array and providing a link to documentation for the latter should be sufficient really. Even within node's own documentation we generally don't duplicate between similar/super objects (e.g. tls.TLSSocket does not show everything inherited from net.Socket). |
Sorry, something went wrong.
|
#28101 (comment) makes sense to me. I wonder, do our docs predate Buffer being derived from Uint8Array? |
Sorry, something went wrong.
Definitely. |
Sorry, something went wrong.
There was a problem hiding this comment.
I think it’s a good change, because it ultimately encourages using a standardized TypedArray method over our non-standard different-behaviour override of another TypedArray method.
Sorry, something went wrong.
Co-Authored-By: Anna Henningsen <github@addaleax.net>
Co-Authored-By: Anna Henningsen <github@addaleax.net>
|
Applied suggested changes! |
Sorry, something went wrong.
|
I’ll land this tomorrow if there are no objections to that. |
Sorry, something went wrong.
Co-Authored-By: Rich Trott <rtrott@gmail.com>
Co-Authored-By: Rich Trott <rtrott@gmail.com>
Co-Authored-By: Rich Trott <rtrott@gmail.com>
Sorry, something went wrong.
PR-URL: nodejs#28101 Refs: nodejs#28087 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
| Back | FazBrowse Home | New Git URL |
refs: #28087
Checklist