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

Refactor getAbi #12

Merged
merged 5 commits into from Sep 6, 2017
Merged

Refactor getAbi #12

merged 5 commits into from Sep 6, 2017

Conversation

juliangruber
Copy link
Contributor

(this is based on #11, so ignore "add missing abi versions to targets")

Yay for less maintenance :)

@juliangruber
Copy link
Contributor Author

(will fix this)

@lgeiger
Copy link
Contributor

lgeiger commented May 26, 2017

@juliangruber Are you still interested in finishing up this PR? 😄

@juliangruber
Copy link
Contributor Author

yes, will do!

@lgeiger
Copy link
Contributor

lgeiger commented May 27, 2017

yes, will do!

Awesome thanks!

@lgeiger
Copy link
Contributor

lgeiger commented Sep 1, 2017

@juliangruber I rebased your PR.

This should now be good to go. getTarget now consistently returns the lowest possible target for a given ABI.

One minor draw back is the slightly increased packages size due to the inclusion of semver but I think it's worth it. This makes it a lot easier to maintain.

@juliangruber
Copy link
Contributor Author

Thank you so much, LVGTM!

@@ -61,7 +61,6 @@ test('getAbi calculates correct Node ABI', function (t) {

test('getAbi calculates correct Electron ABI', function (t) {
t.throws(function () { getAbi(undefined, 'electron') })
t.throws(function () { getAbi('7.2.0', 'electron') })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realized that this changes behavior:
node-abi wouldn't throw anymore if the version isn't supported yet. This could lead to strange behaviors since node-abi would just return the wrong ABI instead. Let me fix that.

@lgeiger lgeiger merged commit fc1eb09 into master Sep 6, 2017
@lgeiger lgeiger deleted the refactor/get-abi branch September 6, 2017 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants