Skip to content

test: remove unnecessary assignments - #4563

Closed
Trott wants to merge 1 commit into
nodejs:v4.x-stagingfrom
Trott:lts-assigns
Closed

test: remove unnecessary assignments#4563
Trott wants to merge 1 commit into
nodejs:v4.x-stagingfrom
Trott:lts-assigns

Conversation

@Trott

@TrottTrott commented Jan 7, 2016

Copy link
Copy Markdown
Member

#4408 backported for LTS.

common.js needs to be loaded in all tests so that there is checking
for variable leaks and possibly other things. However, it does not
need to be assigned to a variable if nothing in common.js is referred
to elsewhere in the test.

The main tradeoff for this bit of code churn is that it gets the code
base most of the way to being able to enable the no-unused-vars rule in
eslint.

(The non-tooling benefit is that it lessens cognitive load when reading
tests as it is an immediate indication that none of the functions or
properties in common.js will be used by the test.)

common.js needs to be loaded in all tests so that there is checking
for variable leaks and possibly other things. However, it does not
need to be assigned to a variable if nothing in common.js is referred
to elsewhere in the test.
The main tradeoff for this bit of code churn is that it gets the code
base most of the way to being able to enable the no-unused-vars rule in
eslint.
(The non-tooling benefit is that it lessens cognitive load when reading
tests as it is an immediate indication that none of the functions or
properties in common.js will be used by the test.)
@TrottTrott added the lts Issues and PRs related to Long Term Support releases. label Jan 7, 2016
@Trott

Trott commented Jan 7, 2016

Copy link
Copy Markdown
MemberAuthor

@bnoordhuis

Copy link
Copy Markdown
Member

Rubber-stamp LGTM. I did notice a few var -> const stylistic changes but that doesn't bother me.

@jasnell

Copy link
Copy Markdown
Member

LGTM

Trott added a commit that referenced this pull request Jan 8, 2016
common.js needs to be loaded in all tests so that there is checking
for variable leaks and possibly other things. However, it does not
need to be assigned to a variable if nothing in common.js is referred
to elsewhere in the test.
The main tradeoff for this bit of code churn is that it gets the code
base most of the way to being able to enable the no-unused-vars rule in
eslint.
(The non-tooling benefit is that it lessens cognitive load when reading
tests as it is an immediate indication that none of the functions or
properties in common.js will be used by the test.)
PR-URL: #4563
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@jasnell

Copy link
Copy Markdown
Member

Landed in v4.x-staging in e9959ab

@jasnelljasnell closed this Jan 8, 2016
MylesBorins pushed a commit that referenced this pull request Jan 19, 2016
common.js needs to be loaded in all tests so that there is checking
for variable leaks and possibly other things. However, it does not
need to be assigned to a variable if nothing in common.js is referred
to elsewhere in the test.
The main tradeoff for this bit of code churn is that it gets the code
base most of the way to being able to enable the no-unused-vars rule in
eslint.
(The non-tooling benefit is that it lessens cognitive load when reading
tests as it is an immediate indication that none of the functions or
properties in common.js will be used by the test.)
PR-URL: #4563
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@MylesBorinsMylesBorins mentioned this pull request Jan 19, 2016
@Trott
Trott deleted the lts-assigns branch January 13, 2022 22:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ltsIssues and PRs related to Long Term Support releases.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@Trott@bnoordhuis@jasnell@mscdex@MylesBorins