-
Notifications
You must be signed in to change notification settings - Fork 30k
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
lib: use const to define constants #541
Conversation
This commit replaces a number of var statements throughout the lib code with const statements.
@cjihrig do you think |
@vkurchatkin I would be in favor of using |
Rubber-stamp LGTM assuming the CI is happy. I personally wouldn't object to a PR that let/const-ifies all the things, noisy though it may be. I'm sure it will shake out a few bugs. |
Just to throw this in the mix, it may be worth running some benchmarks on this change. We had some code that utilized |
@wavded I checked that earlier this week for another PR. I'm reasonably sure that using const and let should be fine now as long as you stick to strict mode. |
@bnoordhuis what's your take on the CI? There is some red, but it seems to be on things that have fluctuated in recent builds. |
good to know, thx @bnoordhuis |
@cjihrig: re CI: there's only one or two persistently failing tests, I can't name them off the top of my head. You should ignore FreeBSD for now, that's still WIP and the Windows MSVS 2015 one can be ignored too and will be removed shortly. The other ones are important to pay attention to. |
@rvagg Ignoring FreeBSD and Windows MSVS 2015, that leaves |
@cjihrig This PR is good to go. The parallel/test-vm-timeout failure is unrelated. |
This commit replaces a number of var statements throughout the lib code with const statements. PR-URL: #541 Reviewed-By: Ben Noordhuis <[email protected]>
Thanks! Landed in 804e7aa |
@bnoordhuis If that's still true, I might help. :) I've never contributed to Node.js but I've worked for the past 2 years on a purely We might even blacklist I know @chrisdickinson is working on switching the linting to ESLint; that might generate a diff touching most JS files at least a little so perhaps it'd be best to wait until that happens? |
@mzgol It recently transpired that let/const still blocks some optimizations in the version of V8 that ships with io.js. I'm afraid that we'll have to take a conservative approach for now. Hopefully the next upgrade will fix that. |
Sure, in that case it's better to wait a little. Michał Gołębiowski |
This commit replaces a number of
var
statements throughout thelib
code withconst
statements.