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

Buffer.slice: Added description for the case when end is greater than… #14720

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -1907,6 +1907,9 @@ changes:
Returns a new `Buffer` that references the same memory as the original, but
offset and cropped by the `start` and `end` indices.

Specifying 'end' greater than ['buf.length'] will return the same result as that of
Copy link
Contributor

@refack refack Aug 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but you should use ` instead of '
The resulting HTML looks different, and only [`bug.length`][] links to the right place - https://github.com/nodejs/node/pull/14720/files?short_path=c4f6105#diff-c4f6105249780774d5b3f276b4e4879f

(edit by @addaleax: fixed markdown)

'end' equal to [buf.length]

*Note*: Modifying the new `Buffer` slice will modify the memory in the
original `Buffer` because the allocated memory of the two objects overlap.

Expand Down