-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
tls: scope loop vars with let #4853
Conversation
`lib/_tls_common.js` had instances of `for` loops that defined variables with `var` such that they were re-declared in the same scope. This change scopes those variables with `let` so that they are not re-declared.
Why wasn't this catched by the linter? |
@ChALkeR We don't (yet) have the In the current code base, that rule fires 227 times. While that may or may not be an acceptable amount of churn for enabling the rule, I'm not so sure that the fixes don't require some examination and thought for each one. It's not always as simple as "oh, just change it from |
@ChALkeR If it's useful at all, here's the results of turning on |
@Trott Ah, thanks! |
LGTM |
LGTM, also cancelled that stuck CI job. |
`lib/_tls_common.js` had instances of `for` loops that defined variables with `var` such that they were re-declared in the same scope. This change scopes those variables with `let` so that they are not re-declared. PR-URL: #4853 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
Thanks! Landed in 6a73dba. |
`lib/_tls_common.js` had instances of `for` loops that defined variables with `var` such that they were re-declared in the same scope. This change scopes those variables with `let` so that they are not re-declared. PR-URL: #4853 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
`lib/_tls_common.js` had instances of `for` loops that defined variables with `var` such that they were re-declared in the same scope. This change scopes those variables with `let` so that they are not re-declared. PR-URL: nodejs#4853 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
`lib/_tls_common.js` had instances of `for` loops that defined variables with `var` such that they were re-declared in the same scope. This change scopes those variables with `let` so that they are not re-declared. PR-URL: #4853 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
`lib/_tls_common.js` had instances of `for` loops that defined variables with `var` such that they were re-declared in the same scope. This change scopes those variables with `let` so that they are not re-declared. PR-URL: #4853 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
`lib/_tls_common.js` had instances of `for` loops that defined variables with `var` such that they were re-declared in the same scope. This change scopes those variables with `let` so that they are not re-declared. PR-URL: #4853 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
`lib/_tls_common.js` had instances of `for` loops that defined variables with `var` such that they were re-declared in the same scope. This change scopes those variables with `let` so that they are not re-declared. PR-URL: #4853 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
`lib/_tls_common.js` had instances of `for` loops that defined variables with `var` such that they were re-declared in the same scope. This change scopes those variables with `let` so that they are not re-declared. PR-URL: nodejs#4853 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
lib/_tls_common.js
had instances offor
loops that defined variableswith
var
such that they were re-declared in the same scope. Thischange scopes those variables with
let
so that they are notre-declared.