assert: Fix deepEqual/deepStrictEqual on equivalent typed arrays#8002
assert: Fix deepEqual/deepStrictEqual on equivalent typed arrays#8002feross wants to merge 2 commits intonodejs:masterfrom feross:fix-8001
Conversation
|
For some reason, I'm getting the following test error after this change: Any ideas? |
|
That test failure looks unrelated and it doesn’t happen for me, does it persist or was it just a one-off? (/cc @ofrobots @pavelfeldman @eugeneo? Maybe you would want to create a @nodejs/v8-inspector team or something for easier pinging?) The code change itself looks good to me (thanks for noticing this!). You might want to use something like a trailing |
|
I can reproduce the failure on |
|
@ofrobots |
|
I can reproduce the failure on |
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: #8001
Let's test typed arrays which have a .byteOffset and .byteLength (i.e. typed arrays that are slices of parent typed arrays).
|
I fixed up the commit message and added a regression test. Thanks, @addaleax! Since the test failures look unrelated, is this ready to merge? |
|
@feross I obviously can’t speak for everyone here, but this LGTM! The commits will be squashed and the subject line shortened to something at most 50 characters in length; that can be done by you or when landing the PR, though. |
|
LGTM |
|
This is a great catch @feross ... LGTM |
|
LGTM |
|
Another CI run since there was a (seemingly unrelated) failure in the last one, just to be safe: https://ci.nodejs.org/job/node-test-pull-request/3569/ |
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: #8001 PR-URL: #8002 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Let's test typed arrays which have a .byteOffset and .byteLength (i.e. typed arrays that are slices of parent typed arrays). PR-URL: #8002 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
Landed in 387ab62 and a8438a0 |
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: #8001 PR-URL: #8002 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Let's test typed arrays which have a .byteOffset and .byteLength (i.e. typed arrays that are slices of parent typed arrays). PR-URL: #8002 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
v4.x appears to have the same problem with the example provided in #8001. Buffer.from does not exist in v4.x, but we can replicate this fix with the original buffer interface. Unfortunately there are still failures when the patch is applied @feross or @jasnell would you be willing to look into backporting? |
|
@thealphanerd I'd love to, but I don't have the time at the moment. If this doesn't get addressed in a few weeks, feel free to ping me again and I'll do my best :) |
|
@feross any more time lately? |
|
@thealphanerd Unfortunately, no. Hopefully someone else can pick this up. |
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 <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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 <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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: #8001 PR-URL: #8002 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Let's test typed arrays which have a .byteOffset and .byteLength (i.e. typed arrays that are slices of parent typed arrays). PR-URL: #8002 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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: #8001 PR-URL: #8002 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Let's test typed arrays which have a .byteOffset and .byteLength (i.e. typed arrays that are slices of parent typed arrays). PR-URL: #8002 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
assert
Description of change
Fix #8001.
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).