Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Update module version for Node 8 #1969

Merged
merged 2 commits into from
May 16, 2017
Merged

Update module version for Node 8 #1969

merged 2 commits into from
May 16, 2017

Conversation

xzyfer
Copy link
Contributor

@xzyfer xzyfer commented May 16, 2017

Was 54 is now 55 will soon be 57.

@xzyfer xzyfer merged commit e736535 into master May 16, 2017
@xzyfer xzyfer deleted the node-8-error branch May 16, 2017 14:52
@@ -69,7 +69,8 @@ function getHumanNodeVersion(abi) {
case 47: return 'Node.js 5.x';
case 48: return 'Node.js 6.x';
case 51: return 'Node.js 7.x';
case 54: return 'Node.js 8.x';
case 55: return 'Node.js 8.x';
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor, but we chould just fall through here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. I did them as discrete commits so I didn't think about it. I want to update this handling so that it only shows as a helpful warning rather than erring out.

Choose a reason for hiding this comment

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

can't we use a dictionary lookup instead of a switch?

function getHumanNodeVersion(abi) {
	var humanNodeVersions={
	   11:'Node 0.10.x',
     14:'Node 0.12.x',
     42:'io.js 1.x',
     43:'io.js 1.1.x',
     44:'io.js 2.x',
     45:'io.js 3.x',
     46:'Node.js 4.x',
     47:'Node.js 5.x',
     48:'Node.js 6.x',
     51:'Node.js 7.x',
     55:'Node.js 8.x',
     57:'Node.js 8.x'
	}
	var version = parseInt(abi || process.versions.modules, 10);
	return humanNodeVersions[version]||false;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could, but I prefer the switch.

@xzyfer
Copy link
Contributor Author

xzyfer commented May 16, 2017

Context: nodejs/citgm#389

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

Successfully merging this pull request may close these issues.

3 participants