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: sorting of targets #99

Merged
merged 2 commits into from
Nov 18, 2020
Merged

fix: sorting of targets #99

merged 2 commits into from
Nov 18, 2020

Conversation

vecerek
Copy link
Contributor

@vecerek vecerek commented Nov 18, 2020

A comparator function for Array.sort should return:

  • a value less than zero if a is less than b
  • zero if a is equal to b
  • a value greater than zero if a is greater than b

The previous implementation of the comparator function (introduced in #95) could only ever return true/false, i.e. 1/0 but no -1. So, what I think happened was that when 0 was returned, Node attempted to apply a default ordering on the objects based on the values of all their properties. That is why a seemingly innocuous change such as changing an lts property from false to true resulted in a broken order. I guess the order was previously correct only by accident 😄

@vecerek vecerek mentioned this pull request Nov 18, 2020
@mafintosh mafintosh merged commit 4293277 into electron:master Nov 18, 2020
@mafintosh
Copy link
Contributor

Yep good fix.

@lgeiger
Copy link
Contributor

lgeiger commented Nov 18, 2020

🎉 This PR is included in version 2.19.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants