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 sort in < V8 7.0 #71

Closed
davidgilbertson opened this issue Feb 22, 2020 · 1 comment · Fixed by #87
Closed

Fix sort in < V8 7.0 #71

davidgilbertson opened this issue Feb 22, 2020 · 1 comment · Fixed by #87
Labels
bug Something isn't working semver-patch

Comments

@davidgilbertson
Copy link
Owner

davidgilbertson commented Feb 22, 2020

V8 7.0 changed the way Array#sort works (so the problem is only in Node.js < 11 and Chrome <70)

In V8 6.x and earlier, something funny is going on when I try to sort using a comparison function. I suspect because with each change to the array, I'm updating state.nextStore, and whatever's happening internally to do the sort is losing a reference.

The pre-7.0 behaviour is explained a bit here: https://v8.dev/blog/array-sort#history

The fix will probably be to bypass all proxies for sort, let the engine do the sort (e.g. on a clone array), then update nextStore with the results.

@davidgilbertson
Copy link
Owner Author

Fixed in 5.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working semver-patch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant