-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: swaps var for let/const throughout common module #10177
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!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if the CI passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if the CI check passes.
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. |
@@ -165,7 +165,7 @@ Object.defineProperty(exports, 'opensslCli', {get: function() { | |||
|
|||
if (exports.isWindows) opensslCli += '.exe'; | |||
|
|||
var openssl_cmd = child_process.spawnSync(opensslCli, ['version']); | |||
const openssl_cmd = child_process.spawnSync(opensslCli, ['version']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you are changing this line, can you change the variable name to use camelCase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thefourtheye sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @homosaur :-)
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?
|
// openssl command cannot be executed | ||
const opensslCmd = child_process.spawnSync(opensslCli, ['version']); | ||
if (opensslCmd.status !== 0 || opensslCmd.error !== undefined) { | ||
// wopenssl command cannot be executed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: typo on "wopenssl" ?
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.