FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

tls: scope loop vars with let by Trott · Pull Request #4853 · nodejs/node · GitHub

/ node Public

tls: scope loop vars with let - #4853

Closed
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:tls-no-redeclare
Closed

tls: scope loop vars with let#4853
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:tls-no-redeclare

Conversation

Trott commented Jan 25, 2016

Copy link
Copy Markdown
Member

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.

`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.
Trott added the tls Issues and PRs related to the tls subsystem. label Jan 25, 2016

ChALkeR commented Jan 25, 2016

Copy link
Copy Markdown
Member

Why wasn't this catched by the linter?

Trott commented Jan 25, 2016

Copy link
Copy Markdown
Member Author

@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.

Trott commented Jan 25, 2016

Copy link
Copy Markdown
Member Author

@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

Trott commented Jan 25, 2016

Copy link
Copy Markdown
Member Author

ChALkeR commented Jan 25, 2016

Copy link
Copy Markdown
Member

@Trott Ah, thanks!

cjihrig commented Jan 25, 2016

Copy link
Copy Markdown
Contributor

LGTM

Copy link
Copy Markdown
Contributor

LGTM, also cancelled that stuck CI job.

silverwind pushed a commit that referenced this pull request Jan 26, 2016
`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>

Copy link
Copy Markdown
Contributor

Thanks! Landed in 6a73dba.

silverwind closed this Jan 26, 2016
rvagg pushed a commit that referenced this pull request Jan 27, 2016
`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>
benjamingr pushed a commit to benjamingr/io.js that referenced this pull request Jan 27, 2016
`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>
rvagg pushed a commit that referenced this pull request Feb 8, 2016
`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>
MylesBorins pushed a commit that referenced this pull request Feb 17, 2016
`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>
MylesBorins pushed a commit that referenced this pull request Feb 18, 2016
`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>
MylesBorins mentioned this pull request Feb 18, 2016
MylesBorins pushed a commit that referenced this pull request Mar 2, 2016
`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>
scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
`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>
Trott deleted the tls-no-redeclare branch January 13, 2022 22:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tls Issues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL