-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
TODO(xzyfer): fix this post Node 8
@@ -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'; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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;
}
There was a problem hiding this comment.
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.
Context: nodejs/citgm#389 |
Was 54 is now 55 will soon be 57.