Uh oh!
There was an error while loading. Please reload this page.
http: convert var to let or const for http - #26504
Conversation
mscdex
commented
Mar 8, 2019
I think we've generally avoided these kinds of commits/PRs and preferred to only update them if you're already affecting those variables because of other changes. |
BeniCheni
commented
Mar 8, 2019
@mscdex, thanks for letting me know. Should I then try A) or B) below? Happy to address either way. A) Revert everything except B) Just close this PR. |
jasnell
commented
Mar 8, 2019
I generally have no problem with these kinds of changes when done in batch. Lots of small changes like this get noisy. |
himself65
commented
Mar 8, 2019
i don’t think these changes have more improvements, but add some noisy commits |
BeniCheni
commented
Mar 8, 2019
@himself65, while it’s true that there are no major improvements, there is an subtle improvement to use “const” over “var” as it will throw an error to “promote” immutability, if a “const” variable’s value is reassigned after its declaration. |
himself65
commented
Mar 8, 2019
@BeniCheni |
@himself65, this is an actual follow-up per a suggestion from another PR, which is an actual change. (could be traced by 1st comment of this PR) The suggestion was to punt the var => let / const to a separate PR. |
BridgeAR
commented
Mar 8, 2019
I guess we might just go ahead and accept a couple PRs like this. Otherwise this is going to come up frequently and as soon as we are through with it, we do not have to worry about it anymore. I am aligned with @jasnell that we should do this as batched change. It is actually quite simple and straight forward to use eslint to auto fix these. Should we just do that? |
ZYSzys
commented
Mar 8, 2019
Would changes like this make |
BridgeAR
commented
Mar 8, 2019
@ZYSzys it adds one more step to find the actual author. Most tools I know / use allow to directly jump to the former blame as well, so I personally do not see this as a big downside anymore. |
I agree this. Also, I think it is better to add |
BridgeAR
commented
Mar 8, 2019
@nodejs/tsc PTAL |
mcollina
left a comment
There was a problem hiding this comment.
Good work! I don’t think this is a good idea just yet. There is still a perf gap in Node 8 when using let, and we still have to do backports there till the end of the year.
BeniCheni
commented
Mar 9, 2019
Thanks for your time and feedback. I’m closing this PR to avoid potential further confusions. |
Refs #26486
Per this comment in #26486 ☝️ , this PR follows up to convert
varvariables toletorconst, in the scope of http source inlib/path.make -j4 test(UNIX), orvcbuild test(Windows) passes