-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
reimplement errname lookup. #38
reimplement errname lookup. #38
Conversation
}; | ||
|
||
// used for testing the fallback behavior. | ||
module.exports._test = errname; |
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.
Maybe we should have a convention of __test__
for when you have to attach something for testing?
9c3a87e
to
d5750c5
Compare
Updated. |
Hmm. Do you think there's more on |
d5750c5
to
eb0df1a
Compare
Not really sure what you're asking. |
const isWin = os.platform() === 'win32'; | ||
|
||
// simulates failure to capture process.binding('uv'); | ||
function fallback(code) { |
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.
const fallback = code => {
looks nicer imo.
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.
@kevva Join the discussion in sindresorhus/eslint-plugin-unicorn#3 ;)
c5ce473
to
b2a3b2b
Compare
I couldn't figure out why there was a test error. Turns out I was testing on Node 4 locally when I thought I had switched to Node 0.12. It seems I'm not even sure how to get negative error codes in Windows (or at all really). |
I think this is ready for merge. Not sure what to do about the |
Nothing. We're doing exactly what Node.js is doing and I personally couldn't care less about 0.12. |
👍 |
Fixes #31
I can not for the life of me figure out how to create a test that actually triggers the affected code in
index.js
. I can't create a negative error code in a way that causes!err
to be true.