Skip to content

debugger: remove variable redeclarations - #4633

Closed
Trott wants to merge 2 commits into
nodejs:masterfrom
Trott:redecl-debugger
Closed

debugger: remove variable redeclarations#4633
Trott wants to merge 2 commits into
nodejs:masterfrom
Trott:redecl-debugger

Conversation

@Trott

Copy link
Copy Markdown
Member

Some variables are declared with var more than once in the same scope. This change reduces the declarations to one per scope.

@cjihrig

Copy link
Copy Markdown
Contributor

I didn't look at the entire file. Would any of these changes work as let instead of hoisting the vars? If so, we should do that. If not, LGTM.

@Trott

Copy link
Copy Markdown
MemberAuthor

I dismissed let out of hand on the grounds that there have been performance concerns around it in the past. Is that a case of throwing out the baby with the bath-water? If so, then there's probably some appropriate let opportunities in here.

@cjihrig

Copy link
Copy Markdown
Contributor

We're using let in other places throughout the codebase. If I understand correctly, let is only problematic in a few edge cases, and likely to continue improving. The debugger also isn't a hot code path.

@jasnell

Copy link
Copy Markdown
Member

LGTM if CI and @cjihrig are happy :-)

@Trott

Copy link
Copy Markdown
MemberAuthor

OK, definitely an option for a let here and a couple of const declarations there. Updated. PTAL.

CI: https://ci.nodejs.org/job/node-test-commit/1714/

@jasnell

Copy link
Copy Markdown
Member

Still LGTM

@cjihrig

Copy link
Copy Markdown
Contributor

LGTM too.

@Trott

Copy link
Copy Markdown
MemberAuthor

Trott added a commit to Trott/io.js that referenced this pull request Jan 16, 2016
Some variables are declared with var more than once in the same scope.
This change reduces the declarations to one per scope.
PR-URL: nodejs#4633
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@Trott

Copy link
Copy Markdown
MemberAuthor

Landed in 66b9c0d

@TrottTrott closed this Jan 16, 2016
evanlucas pushed a commit that referenced this pull request Jan 18, 2016
Some variables are declared with var more than once in the same scope.
This change reduces the declarations to one per scope.
PR-URL: #4633
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 28, 2016
Some variables are declared with var more than once in the same scope.
This change reduces the declarations to one per scope.
PR-URL: #4633
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Feb 11, 2016
Some variables are declared with var more than once in the same scope.
This change reduces the declarations to one per scope.
PR-URL: #4633
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit to MylesBorins/node that referenced this pull request Feb 11, 2016
Some variables are declared with var more than once in the same scope.
This change reduces the declarations to one per scope.
PR-URL: nodejs#4633
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Feb 11, 2016
MylesBorins pushed a commit to MylesBorins/node that referenced this pull request Feb 15, 2016
Some variables are declared with var more than once in the same scope.
This change reduces the declarations to one per scope.
PR-URL: nodejs#4633
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
Some variables are declared with var more than once in the same scope.
This change reduces the declarations to one per scope.
PR-URL: nodejs#4633
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@Trott
Trott deleted the redecl-debugger branch January 13, 2022 22:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Trott@cjihrig@jasnell@MylesBorins