Skip to content

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

@kevinburke

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.docIssues and PRs related to the documentations.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