| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
A bit of a tangent but: Not sure if this will get a 👍 or a 👎 from the maintainers, but either way, if the common.js file is of interest to you, one thing that we definitely need is improved documentation of its properties in test/README.md. For example, current documentation for allowGlobals() says:
That's a correct description of the algorithm, but it doesn't tell you what I might use the function for. (It appends whitelist to the list of known global variables so that variables listed in whitelist are not flagged as unintentionally leaked globals by common.js. It's a way of saying, "I know I'm leaking these global variables, don't warn me about them.") (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!) |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM if the CI passes.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM if the CI check passes.
Sorry, something went wrong.
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: test: swaps var for let/const throughout |
Sorry, something went wrong.
|
@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! |
Sorry, something went wrong.
|
Tiny nit on the commit message (which someone can fix when landing if you don't get around to it): swaps -> swap on the first line. Guidelines say the verb should be "imperative mode" (or at least, that's what I recall) so swap (active command-like) rather than swaps (descriptive). |
Sorry, something went wrong.
Sorry, something went wrong.
|
@Trott CI failures seem to be due to pull issues with Jenkins, not code |
Sorry, something went wrong.
|
Jenkins was having issues. Let's try again. |
Sorry, something went wrong.
There was a problem hiding this comment.
Now that you are changing this line, can you change the variable name to use camelCase?
Sorry, something went wrong.
There was a problem hiding this comment.
@thefourtheye sure!
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks @homosaur :-)
Sorry, something went wrong.
Sorry, something went wrong.
|
Single CI failure seems unrelated, but since common.js is central to the tests, let's run again. |
Sorry, something went wrong.
|
@Trott still seems like maybe some technical issues with CI |
Sorry, something went wrong.
|
NEVER TOO MANY CI RUNS! |
Sorry, something went wrong.
|
CAN'T GET ENOUGH CI! |
Sorry, something went wrong.
|
(CI is ✅ even if the widget says otherwise.) |
Sorry, something went wrong.
|
@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 var? |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
@homosaur that's because let is block scoped while var isn't. |
Sorry, something went wrong.
|
@lpinca Changed block to your suggestion, test suite does pass. Thanks! |
Sorry, something went wrong.
|
@homosaur thanks, can I ask one last thing? Would you mind updating the commit message to reflect the changes? test: swap var for let/const in common.js module * swap var for let/const throughout the common.js module * change variable name from openssl_cmd to opensslCmd |
Sorry, something went wrong.
There was a problem hiding this comment.
Nit: typo on "wopenssl" ?
Sorry, something went wrong.
Swap var for let/const throughout the common.js module. Change a snake case variable to camel case starting on line 168.
Sorry, something went wrong.
|
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/ |
Sorry, something went wrong.
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>
|
This has landed cleanly in v6.x without any problems. Please feel free to manually backport to v4.x-staging |
Sorry, something went wrong.
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>
| Back | FazBrowse Home | New Git URL |
Checklist
Affected 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.