Skip to content

Conversation

@Trott
Copy link
Member

Add coverage for non-numeric byteOffset and length when using
Buffer.from() with an ArrayBuffer.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test buffer

@TrottTrott added buffer Issues and PRs related to the buffer subsystem. test Issues and PRs related to the tests. labels Apr 17, 2017
Copy link
Contributor

@cjihrigcjihrig left a comment

Choose a reason for hiding this comment

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

Not sure if byteoffset in the comment should be byteOffset, but either way, LGTM.

Copy link
Member

Choose a reason for hiding this comment

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

This is fine, but it may be worthwhile to test additional non-numeric inputs (object, array, NaN, etc).

For instance:

  • Buffer.from(ab, NaN), offset defaults to 0
  • Buffer.from(ab, Infinity) throws
  • Buffer.from(ab,{})offset defaults to 0
  • Buffer.from(ab, [])offset defaults to 0
  • Buffer.from(ab, [1]) ``offset is 1

etc...

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Added these. PTAL. Thanks.

Add coverage for non-numeric byteOffset and length when using Buffer.from() with an ArrayBuffer.
@Trott
Copy link
MemberAuthor

@cjihrig Updated the comment. Thanks.

@Trott
Copy link
MemberAuthor

@jasnell
Copy link
Member

Failure in CI is unrelated.

jasnell pushed a commit that referenced this pull request Apr 19, 2017
Add coverage for non-numeric byteOffset and length when using Buffer.from() with an ArrayBuffer. PR-URL: #12476 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

LAnded in d78fd26

@jasnelljasnell closed this Apr 19, 2017
evanlucas pushed a commit that referenced this pull request Apr 25, 2017
Add coverage for non-numeric byteOffset and length when using Buffer.from() with an ArrayBuffer. PR-URL: #12476 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
@evanlucasevanlucas mentioned this pull request May 1, 2017
evanlucas pushed a commit that referenced this pull request May 1, 2017
Add coverage for non-numeric byteOffset and length when using Buffer.from() with an ArrayBuffer. PR-URL: #12476 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
evanlucas pushed a commit that referenced this pull request May 2, 2017
Add coverage for non-numeric byteOffset and length when using Buffer.from() with an ArrayBuffer. PR-URL: #12476 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
gibfahn pushed a commit that referenced this pull request May 16, 2017
Add coverage for non-numeric byteOffset and length when using Buffer.from() with an ArrayBuffer. PR-URL: #12476 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request May 18, 2017
Add coverage for non-numeric byteOffset and length when using Buffer.from() with an ArrayBuffer. PR-URL: #12476 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request May 23, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
Add coverage for non-numeric byteOffset and length when using Buffer.from() with an ArrayBuffer. PR-URL: nodejs/node#12476 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
@TrottTrott deleted the arraybuffer branch January 13, 2022 22:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bufferIssues and PRs related to the buffer subsystem.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Trott@jasnell@cjihrig@gibfahn