-
Notifications
You must be signed in to change notification settings - Fork 733
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 os.tmpdir
bug
#240
Fix os.tmpdir
bug
#240
Conversation
The checked method on `os` module was `tempDir` which was not existing on any version of Node (should have been `tmpDir`). With Node 0.10, the name became `tmpdir`.
I agree, it looks like it should say Could you provide an example of buggy behavior and the expected behavior? |
@nfischer - you can check the ticket on ESLint that refers to this one: eslint/eslint#4061 In short, instead of using the built-in |
After looking into things a bit, I agree with the change of Unless there's discussion of getting rid of Other than that, this looks like something we would merge fairly soon. |
@nfischer I also double checked from my console in Node 4 and So my suggestion is either dropping the undocumented |
Ok, you raise a good point about it being undocumented. Since this operation should only be performed once (and the result will be cached), it shouldn't bloat things too much. A comment linking back might be a good (plus, it'll trigger the CI so we can verify that it doesn't break things). LGTM, once the CI passes |
@ariporad what are your thoughts? |
@nfischer: I'm not sure I understand this 100%, but I think that the best thing to do would be |
@ariporad You suggestion works if at least one of the three functions exists. The issue is that early versions (before 0.8) don't have any of those functions. So if If we do it in multiple lines as it is, it will never call the function unless it actually exists (so the code works as expected). As this PR is written, it fixes the typo (which is good), and it prefers the newer (and actually documented) name |
@nfischer: Then LGTM! |
The checked method on
os
module wastempDir
which was not existing on any version of Node (should have beentmpDir
). With Node 0.10, the name becametmpdir
.