GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — lib: name anonymous callbacks by mlrv · Pull Request #21412 · nodejs/node Conversation
Contributor
First contribution here! This commit is to help in the effort to name all anonymous Refs: #8913 Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Trott
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that supposed to be
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this and following up! 🎉
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Glad to see it all seems to go well :) If I understood correctly, the standard process is to wait at least 48 hours before merging, am I right? Is there anything else that needs to be done? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mlrv that is correct, we can fast track this one though since it's naming rather than functionality. This is all explained here: https://github.com/nodejs/node/blob/master/COLLABORATOR_GUIDE.md#waiting-for-approvals . It also explicitly states that since this is a Collaborators 👍 this comment to support fast-tracking this change. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CI again to try to confirm Windows failure is unlikely to be related: https://ci.nodejs.org/job/node-test-pull-request/15538/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hmmm... let's try a total re-run: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hi @mlrv — thank you for working on this. In my opinion naming should provide some value, rather than just being decorative. Names such as socketOnceCallback do not help anyone and do not make the stack trace any more descriptive than an anonymous function would. I've left some comments regarding some potentially more useful names.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
pipeOnDrainCallback? It won't be "inner" by the time it's in a stack trace.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
socketSetTimeoutOnConnect?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
socketDestroyOnConnect?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Switch to an anonymous function instead of naming it? The function name is not particularly useful.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I thought there was consensus that naming anonymous callback functions was helpful. If that's not the case, I should update #8913 (comment).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@apapirovski any update on this?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
My bad here as far as dropping the ball and misphrasing. What I meant to say is: I think this should just be an arrow function. I don't think we gain much by naming callbacks for things like String.prototype.replace.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I implemented the suggestions and fixed the conflicts. Happy to go ahead if all the checks are green?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @apapirovski, thanks for the feedback, I totally see your point. Happy to change the names if you think those could be more helpful. On the last comment, not sure I agree with you, what do other people think? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I would suggest just using (all, key, val) => { here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@benjamingr all green, good to go? :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
not sure about the arrow function fitting in with the rest but won't block
|
Weird. CI failed on git due to a conflict. Let's try again... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GitHub says this has no conflicts with the base branch, but manually trying to apply the changes shows conflicts. I'll resolve them, push back up, and restart CI. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This commit is to help in the effort to name all anonymous functions to help when heap debugging. Specifically, this commit fixes some anonymous functions used as listeners in the lib/ folder. Refs: nodejs#8913
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Might be good for people to double-check the changes now that I've done a rebase and resolved conflicts. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Resume Build: https://ci.nodejs.org/job/node-test-pull-request/16165/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This commit is to help in the effort to name all anonymous functions to help when heap debugging. Specifically, this commit fixes some anonymous functions used as listeners in the lib/ folder. PR-URL: #21412 Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Jon Moss <[email protected]> Refs: #8913
|
Landed in d7496bf, congrats on your first PR to Node.js! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This commit is to help in the effort to name all anonymous functions to help when heap debugging. Specifically, this commit fixes some anonymous functions used as listeners in the lib/ folder. PR-URL: #21412 Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Jon Moss <[email protected]> Refs: #8913
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.