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

fs: refactor redeclared variables by Trott · Pull Request #4959 · nodejs/node · GitHub

/ node Public

fs: refactor redeclared variables - #4959

Closed
Trott wants to merge 2 commits into
nodejs:masterfrom
Trott:fs-no-redeclare
Closed

fs: refactor redeclared variables#4959
Trott wants to merge 2 commits into
nodejs:masterfrom
Trott:fs-no-redeclare

Conversation

Trott commented Jan 29, 2016

Copy link
Copy Markdown
Member

Two variables are declared twice with var in the same scope in
lib/fs.js. This change refactors the code so the variable is declared
just once.

Two variables are declared twice with `var` in the same scope in
`lib/fs.js`. This change refactors the code so the variable is declared
just once.
Trott added fs Issues and PRs related to the fs subsystem / file system. lts-watch-v4.x labels Jan 29, 2016

Copy link
Copy Markdown
Member

LGTM

Trott commented Jan 30, 2016

Copy link
Copy Markdown
Member Author

mscdex commented Jan 30, 2016

Copy link
Copy Markdown
Contributor

LGTM

Comment thread lib/fs.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

this is fine but...

const nextPartRe = isWindows ? 
  /(.*?)(?:[\/\\]+|$)/g : 
  /(.*?)(?:[\/]+|$)/g;

const splitRootRe = isWindows ?
  /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/ :
  /^[\/]*/;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I thought about doing that, but wanted to keep the change as small as reasonable. But that was a guideline I applied and not a hard rule, so yeah, I'm happy to make that change.

jasnell commented Feb 1, 2016

Copy link
Copy Markdown
Member

minor suggestion but LGTM

cjihrig commented Feb 1, 2016

Copy link
Copy Markdown
Contributor

LGTM with @jasnell's comment.

Trott commented Feb 1, 2016

Copy link
Copy Markdown
Member Author

Switched to ternary operator per comment from @jasnell.

CI again: https://ci.nodejs.org/job/node-test-pull-request/1486/

Trott added a commit to Trott/io.js that referenced this pull request Feb 1, 2016
Two variables are declared twice with `var` in the same scope in
`lib/fs.js`. This change refactors the code so the variable is declared
just once.

PR-URL: nodejs#4959
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

Trott commented Feb 1, 2016

Copy link
Copy Markdown
Member Author

Landed in 7a2a551

Trott closed this Feb 1, 2016
rvagg pushed a commit that referenced this pull request Feb 8, 2016
Two variables are declared twice with `var` in the same scope in
`lib/fs.js`. This change refactors the code so the variable is declared
just once.

PR-URL: #4959
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Feb 17, 2016
Two variables are declared twice with `var` in the same scope in
`lib/fs.js`. This change refactors the code so the variable is declared
just once.

PR-URL: #4959
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Feb 18, 2016
Two variables are declared twice with `var` in the same scope in
`lib/fs.js`. This change refactors the code so the variable is declared
just once.

PR-URL: #4959
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins mentioned this pull request Feb 18, 2016
MylesBorins pushed a commit that referenced this pull request Mar 2, 2016
Two variables are declared twice with `var` in the same scope in
`lib/fs.js`. This change refactors the code so the variable is declared
just once.

PR-URL: #4959
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
Two variables are declared twice with `var` in the same scope in
`lib/fs.js`. This change refactors the code so the variable is declared
just once.

PR-URL: nodejs#4959
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Trott deleted the fs-no-redeclare branch January 13, 2022 22:42
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

fs Issues and PRs related to the fs subsystem / file system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL