| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
`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? |
Sorry, something went wrong.
|
@ChALkeR We don't (yet) have the no-redeclare rule turned on. 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 var to const" or "declare it once at the top" or whatever. Or at least sometimes "declare it once at the top" isn't always the best solution. (This change, in this PR, is an example of that, I think. It makes sense for the variables to be scoped and not hoisted here.) So, I'm doing little digestible bits and pieces. |
Sorry, something went wrong.
|
@ChALkeR If it's useful at all, here's the results of turning on no-redeclare on current master: https://gist.github.com/Trott/7dc16adf550b6a8d06cc |
Sorry, something went wrong.
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
LGTM, also cancelled that stuck CI job. |
Sorry, something went wrong.
`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 <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`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 <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`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 <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`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 <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`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 <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`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 <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`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 <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
`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 <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
| Back | FazBrowse Home | New Git URL |
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.