Skip to content

Buffer.slice: Document behavior if end > slice.length #14714

Description

@kevinburke

The documentation for Buffer.slice says this about end:

end Where the new Buffer will end (not inclusive). Default: buf.length

It does not describe what happens if end is greater than the length of the buffer. Does Node return a buffer of length (end - start) with zero values for the extra values? Does it return a shorter buffer? Does it throw a RangeError?

Activity

  1. added
    docIssues and PRs related to Node.js documentation.
    on Aug 9, 2017
  2. cjihrig commented on Aug 9, 2017

    @cjihrig
    Contributor

    Care to submit a documentation PR?

  3. added
    bufferIssues and PRs related to the buffer subsystem.
    on Aug 9, 2017
  4. added a commit that references this issue on Aug 9, 2017
    991183c
  5. added
    wipIssues and PRs that are still a work in progress.
    on Aug 9, 2017
  6. kevinburke commented on Aug 10, 2017

    @kevinburke
    Author
  7. cjihrig commented on Aug 10, 2017

    @cjihrig
    Contributor

    Looks like it's been taken care of: #14720

  8. kevinburke commented on Aug 12, 2017

    @kevinburke
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.docIssues and PRs related to Node.js documentation.wipIssues and PRs that are still a work in progress.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions