Node: doc: Buffer.prototype.byteLength is undocumented

Created on 27 Aug 2020  路  6Comments  路  Source: nodejs/node

馃摋 API Reference Docs Problem

  • Subsystem: buffer

Location

Affected URL(s):

Description

Buffer instances have a undocumented .byteLength property. We should document it. Docs only exist for the static method Buffer.byteLength but not for Buffer.prototype.byteLength.

````js

Buffer.from("馃摋").byteLength
4
````


  • [ ] I would like to work on this issue and submit a pull request.
buffer doc

All 6 comments

I believe that's because it's inherited from TypedArray.

I would like to work on this issue and submit a pull request.

@silverwind Can I document property under buffer class

@mscdex isn't it coming from ArrayBuffer#byteLength?

@PoojaDurgad Let's first get clearance whether we document inherited properties or not. Once that is decided, I'd suggest adding it below the buf.buffer prototype method, possibly with just a link to MDN.

@silverwind Not necessarily. If the Buffer/Uint8Array is a subset of the backing ArrayBuffer, then the subset length will be returned and not the ArrayBuffer length.

Removing Good first issue for now as it's not as trivial as I thought it would be.

Was this page helpful?
0 / 5 - 0 ratings