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

Backport: assert: Fix deepEqual/deepStrictEqual on equivalent typed arrays #9776

Closed
wants to merge 2 commits into from

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Nov 23, 2016

This is a backport of #8002 to v4.

Note, the exact API used to implement this doesn't seem to exist in v4, so I combined new Buffer() and slice().

R= @thealphanerd @feross

The typed array's underlying ArrayBuffer is used in `Buffer.from`.
Let's respect it's .byteOffset or .byteLength (i.e. position within the
parent ArrayBuffer).

Fixes: nodejs#8001
PR-URL: nodejs#8002
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Prince John Wesley <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Let's test typed arrays which have a .byteOffset and .byteLength (i.e.
typed arrays that are slices of parent typed arrays).

PR-URL: nodejs#8002
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Prince John Wesley <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@nodejs-github-bot nodejs-github-bot added assert Issues and PRs related to the assert subsystem. v4.x labels Nov 23, 2016
@feross
Copy link
Contributor

feross commented Nov 24, 2016

Note, the exact API used to implement this doesn't seem to exist in v4

Which API is that?

@addaleax
Copy link
Member

@feross That would be the three-argument new Buffer(arrayBuffer, offset, length) variant of the Buffer constructor

@MylesBorins
Copy link
Contributor

landed in 76245b2...c0c5608

@cjihrig cjihrig deleted the 8002bp branch December 20, 2016 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert Issues and PRs related to the assert subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants