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 cloning typed arrays #3

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Fix cloning typed arrays #3

merged 1 commit into from
Apr 8, 2024

Conversation

scagood
Copy link
Contributor

@scagood scagood commented Aug 22, 2023

This attempts to fix Typed Array cloning.


I had to add a node version check in the tests because:

  1. TypedArray.from was added in node 4
Image of failed test runs in actions summary image

I have pre-run all the tests already here:

Name Link
Tests: node.js >= 10 https://github.com/scagood/js-traverse/actions/runs/5943582826
Tests: node.js < 10 https://github.com/scagood/js-traverse/actions/runs/5943582822
Tests: pretest/posttest https://github.com/scagood/js-traverse/actions/runs/5943582818

index.js Outdated Show resolved Hide resolved
test/mutability.js Outdated Show resolved Hide resolved
test/mutability.js Outdated Show resolved Hide resolved
test/typed-array.js Outdated Show resolved Hide resolved
test/typed-array.js Outdated Show resolved Hide resolved
test/typed-array.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
scagood

This comment was marked as outdated.

@scagood

This comment was marked as outdated.

.eslintrc Outdated Show resolved Hide resolved
Copy link
Owner

@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.

I've rebased this, and pulled some of the smaller changes into main.

test/lib/semver.js Outdated Show resolved Hide resolved
@ljharb
Copy link
Owner

ljharb commented Sep 11, 2023

This seems good; I’ve got a bunch of TODOs to replace inline code with deps, so I’m thinking about the best release plan for that before merging this.

@ljharb ljharb force-pushed the typed-arrays branch 5 times, most recently from 2527b11 to 18c32c5 Compare December 21, 2023 01:24
@ljharb
Copy link
Owner

ljharb commented Dec 21, 2023

@scagood turns out Uint8Array.from isn't always available, so I changed it to new Uint8Array; then tests revealed that copying a Typed Array would be easier using typedarray.prototype.slice; now they're failing in another place because BYTES_PER_ELEMENT is readonly.

Please fetch my latest changes and work off of those; I'll mark this PR as a draft until the tests are passing again.

@ljharb ljharb marked this pull request as draft December 21, 2023 01:25
 This fixes a crash in node 0.8 and 0.10
index.js Outdated Show resolved Hide resolved
Copy link
Owner

@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.

Thanks!

@ljharb ljharb merged commit 595d64e into ljharb:main Apr 8, 2024
321 checks passed
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