test: swaps var for let/const throughout common module#10177
test: swaps var for let/const throughout common module#10177homosaur wants to merge 1 commit intonodejs:masterfrom homosaur:test/common
Conversation
|
A bit of a tangent but: Not sure if this will get a 👍 or a 👎 from the maintainers, but either way, if the For example, current documentation for
That's a correct description of the algorithm, but it doesn't tell you what I might use the function for. (It appends (No disrespect to @paulgrock who put those initial descriptions there in the first place. Before that, we had nothing. Now, we have a starting point!) |
It doesn't though, please format the commit message according to https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit Atm, it is one-line and says: |
|
@ChALkeR I enhanced the commit message with the explanation from this PR. Thought the commit was self explanatory but have read the commit guidelines more thoroughly. Thanks! |
|
Tiny nit on the commit message (which someone can fix when landing if you don't get around to it): |
|
@Trott CI failures seem to be due to pull issues with Jenkins, not code |
|
Jenkins was having issues. Let's try again. |
test/common.js
Outdated
There was a problem hiding this comment.
Now that you are changing this line, can you change the variable name to use camelCase?
|
Single CI failure seems unrelated, but since |
|
@Trott still seems like maybe some technical issues with CI |
|
NEVER TOO MANY CI RUNS! |
|
CAN'T GET ENOUGH CI! |
|
(CI is ✅ even if the widget says otherwise.) |
|
@homosaur I was reading your commit message
This seems to work diff --git a/test/common.js b/test/common.js
index e231547fc5..d138310aa6 100644
--- a/test/common.js
+++ b/test/common.js
@@ -41,8 +41,9 @@ exports.rootDir = exports.isWindows ? 'c:\\' : '/';
exports.buildType = process.config.target_defaults.default_configuration;
function rimrafSync(p) {
+ let st;
try {
- var st = fs.lstatSync(p);
+ st = fs.lstatSync(p);
} catch (e) {
if (e.code === 'ENOENT')
return;are you ok with swapping that last |
|
Sure, @lpinca, I'm glad you found a way around that. I'm curious what causes the variable to need to be instantiated outside the try/catch block but I think it's a way to remove that last bit. Thanks for taking a look at that line. |
|
I'm guessing that try/catch is considered a scoping block for let, which is why it doesn't then understand the st call in the next try/catch block. That makes sense logically. |
|
@homosaur that's because |
|
@homosaur exactly :) |
|
@lpinca Changed block to your suggestion, test suite does pass. Thanks! |
|
@homosaur thanks, can I ask one last thing? Would you mind updating the commit message to reflect the changes? |
test/common.js
Outdated
Swap var for let/const throughout the common.js module. Change a snake case variable to camel case starting on line 168.
|
Linter error was probably the one that was in master for a few hours and not in this PR. Running linter again: https://ci.nodejs.org/job/node-test-linter/6015/ |
Swap var for let/const throughout the common.js module. Change a snake case variable to camel case starting on line 168. PR-URL: #10177 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in ecd11b6 |
Swap var for let/const throughout the common.js module. Change a snake case variable to camel case starting on line 168. PR-URL: #10177 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Swap var for let/const throughout the common.js module. Change a snake case variable to camel case starting on line 168. PR-URL: #10177 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
This has landed cleanly in v6.x without any problems. Please feel free to manually backport to v4.x-staging |
Swap var for let/const throughout the common.js module. Change a snake case variable to camel case starting on line 168. PR-URL: #10177 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Swap var for let/const throughout the common.js module. Change a snake case variable to camel case starting on line 168. PR-URL: #10177 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Swap var for let/const throughout the common.js module. Change a snake case variable to camel case starting on line 168. PR-URL: #10177 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
Description of change
Swaps var for let/const throughout the common.js module.
Also changes a rogue snake case var to camel case.