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

[Fix] io.js 3.0 - Node.js 5.3 typed array support #25

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

ChALkeR
Copy link
Contributor

@ChALkeR ChALkeR commented Nov 20, 2024

  1. Between io.js 3.0 and Node.js 5.3, typed arrays are supported, but Buffer(ab, offset, length) wasn't. So add a recheck for that case.
  2. Between io.js 3.0 and Node.js 4.4, (1) also hit Buffers, as they are not passing fast-path instanceof check there due to safe-buffer
    Which was a regression in [Fix] return valid values on multi-byte-wide TypedArray input #23
  3. Between Node.js 5.0 and 6.3.0, Buffer(new Uint8Array(0).buffer) fails on empty buffers, add a hack for that
  4. Also refactor code a bit

Refs: browserify/hash-base#19

@ljharb
Copy link
Member

ljharb commented Nov 25, 2024

LGTM after some added tests

@ChALkeR
Copy link
Contributor Author

ChALkeR commented Nov 26, 2024

Added tests for (1-2) and (3)

@ChALkeR
Copy link
Contributor Author

ChALkeR commented Nov 26, 2024

Wait, I apparently pushed... not here. Fixed

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Confirm the tests fail without the fix, in node 3 - 5.

@ljharb ljharb changed the title fix: io.js 3.0 - Node.js 5.3 typed array support [Fix] io.js 3.0 - Node.js 5.3 typed array support Nov 26, 2024
@ljharb ljharb merged commit b7ddd2a into browserify:master Nov 26, 2024
406 checks passed
@ljharb
Copy link
Member

ljharb commented Nov 26, 2024

Published in v1.0.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants