Skip to content

Add assert.equal for length of Buffer.concat(list, length) #11605

Description

@JacksonTian
  • Version: all
  • Platform: all
  • Subsystem: buffer

I don't know why/when user pass into invalid length. Hope to get more points for it.

Activity

  1. added
    bufferIssues and PRs related to the buffer subsystem.
    on Feb 28, 2017
  2. cjihrig commented on Feb 28, 2017

    @cjihrig
    Contributor

    Is your question why this returns an empty buffer instead of throwing:

    const buf = Buffer.concat([Buffer.from('abc'), Buffer.from('def')], 'xyz');

    Or why this automatically truncates instead of throwing:

    Buffer.concat([Buffer.from('abc'), Buffer.from('def')], 1)

    Or something else?

  3. JacksonTian commented on Mar 1, 2017

    @JacksonTian
    ContributorAuthor

    Thanks, @cjihrig . That's my point.

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.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions