GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: name anonymous callbacks by mlrv · Pull Request #21412 · nodejs/node

Conversation

@mlrv

@mlrv mlrv commented Jun 19, 2018

Copy link
Copy Markdown
Contributor

First contribution here!

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: #8913

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

benjamingr reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot nodejs-github-bot added http Issues and PRs related to the http subsystem. stream Issues and PRs related to Node.js streams. tls Issues and PRs related to the tls subsystem. labels Jun 19, 2018
Trott
Trott reviewed Jun 19, 2018
View reviewed changes
Comment thread lib/_tls_common.js Outdated

@Trott Trott Jun 19, 2018

Copy link
Copy Markdown
Member

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.

Is that supposed to be replaceCallback instead of replacerCallback?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mlrv mlrv Jun 20, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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.

It wasn't a typo in my head. I suppose that it makes sense in both versions:

  • replacerCallback -> the replacer function (inside replace)
  • replaceCallback -> the callback of the replace function

Happy to change it of course

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Trott Trott Jun 20, 2018

Copy link
Copy Markdown
Member

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.

Nah, if it wasn't a typo, it's fine with me. Just wanted to give you the opportunity to fix it up if it was a mistake.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Trott
Trott previously approved these changes Jun 19, 2018
View reviewed changes

@Trott Trott left a comment

Copy link
Copy Markdown
Member

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 CI is green

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
starkwang
starkwang approved these changes Jun 20, 2018
View reviewed changes
trivikr
trivikr approved these changes Jun 20, 2018
View reviewed changes
@trivikr

trivikr commented Jun 20, 2018

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trivikr trivikr added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jun 20, 2018
benjamingr
benjamingr approved these changes Jun 20, 2018
View reviewed changes

@benjamingr benjamingr left a comment

Copy link
Copy Markdown
Member

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 for doing this and following up! 🎉

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mlrv

mlrv commented Jun 20, 2018

Copy link
Copy Markdown
Contributor Author

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@benjamingr

benjamingr commented Jun 20, 2018

Copy link
Copy Markdown
Member

@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 good-first-issue then fast-tracking might be appropriate.

Collaborators 👍 this comment to support fast-tracking this change.

BridgeAR reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

BridgeAR
BridgeAR approved these changes Jun 20, 2018
View reviewed changes
@BridgeAR BridgeAR added the fast-track PRs proposed for a shorter-than-standard waiting period before landing. label Jun 20, 2018
@Trott

Trott commented Jun 20, 2018

Copy link
Copy Markdown
Member

CI again to try to confirm Windows failure is unlikely to be related: https://ci.nodejs.org/job/node-test-pull-request/15538/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lpinca
lpinca approved these changes Jun 20, 2018
View reviewed changes
jasnell
jasnell approved these changes Jun 21, 2018
View reviewed changes
@Trott

Trott commented Jun 21, 2018

Copy link
Copy Markdown
Member

Hmmm... let's try a total re-run:

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

apapirovski
apapirovski suggested changes Jun 25, 2018
View reviewed changes

@apapirovski apapirovski left a comment

Copy link
Copy Markdown
Contributor

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.

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/_stream_readable.js Outdated

@apapirovski apapirovski Jun 25, 2018

Copy link
Copy Markdown
Contributor

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.

pipeOnDrainCallback? It won't be "inner" by the time it's in a stack trace.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/_http_outgoing.js Outdated

@apapirovski apapirovski Jun 25, 2018

Copy link
Copy Markdown
Contributor

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.

socketSetTimeoutOnConnect?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/_http_outgoing.js Outdated

@apapirovski apapirovski Jun 25, 2018

Copy link
Copy Markdown
Contributor

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.

socketDestroyOnConnect?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/_tls_common.js Outdated

@apapirovski apapirovski Jun 25, 2018

Copy link
Copy Markdown
Contributor

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.

Switch to an anonymous function instead of naming it? The function name is not particularly useful.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Trott Trott Jun 26, 2018

Copy link
Copy Markdown
Member

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.

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.

Uh oh!

There was an error while loading. Please reload this page.

mlrv reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@mlrv mlrv Jun 29, 2018

Copy link
Copy Markdown
Contributor Author

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.

@apapirovski any update on this?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@apapirovski apapirovski Jul 29, 2018

Copy link
Copy Markdown
Contributor

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.

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mlrv mlrv Jul 29, 2018

Copy link
Copy Markdown
Contributor Author

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.

I implemented the suggestions and fixed the conflicts. Happy to go ahead if all the checks are green?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mlrv

mlrv commented Jun 26, 2018

Copy link
Copy Markdown
Contributor Author

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax removed author ready PRs with CI started, the required approvals, and no outstanding review comments. fast-track PRs proposed for a shorter-than-standard waiting period before landing. labels Jul 13, 2018
@maclover7 maclover7 added the wip Issues and PRs that are still a work in progress. label Jul 28, 2018
apapirovski
apapirovski reviewed Jul 30, 2018
View reviewed changes
Comment thread lib/_tls_common.js Outdated

@apapirovski apapirovski Jul 30, 2018

Copy link
Copy Markdown
Contributor

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.

I would suggest just using (all, key, val) => { here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
apapirovski
apapirovski approved these changes Jul 30, 2018
View reviewed changes
@mlrv

mlrv commented Jul 30, 2018

Copy link
Copy Markdown
Contributor Author

@benjamingr all green, good to go? :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@benjamingr benjamingr added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jul 30, 2018
@Trott

Trott commented Aug 1, 2018

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott
Trott dismissed their stale review August 1, 2018 01:25

not sure about the arrow function fitting in with the rest but won't block

@Trott

Trott commented Aug 1, 2018

Copy link
Copy Markdown
Member

Weird. CI failed on git due to a conflict. Let's try again...

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Aug 1, 2018

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mlrv added 4 commits July 31, 2018 18:37
@mlrv @Trott
lib: name anonymous callbacks
607ee37
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
@mlrv @Trott
Improved naming
72c2573
@mlrv @Trott
Make linter happy
fa194ca
@mlrv @Trott
Use arrow function
b1e3dc1
@Trott
Trott force-pushed the marco/issue-8913 branch from 760ec4c to b1e3dc1 Compare August 1, 2018 01:39
@Trott

Trott commented Aug 1, 2018

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Aug 1, 2018

Copy link
Copy Markdown
Member

Might be good for people to double-check the changes now that I've done a rebase and resolved conflicts.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

maclover7
maclover7 approved these changes Aug 3, 2018
View reviewed changes
@maclover7 maclover7 removed the wip Issues and PRs that are still a work in progress. label Aug 3, 2018
@Trott

Trott commented Aug 3, 2018

Copy link
Copy Markdown
Member

Resume Build: https://ci.nodejs.org/job/node-test-pull-request/16165/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

maclover7 pushed a commit that referenced this pull request Aug 4, 2018
@mlrv @maclover7
http,tls: name anonymous callbacks
d7496bf
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
@maclover7

maclover7 commented Aug 4, 2018

Copy link
Copy Markdown
Contributor

Landed in d7496bf, congrats on your first PR to Node.js!
❤️ 💚 💙 💛 💜

benjamingr reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maclover7 maclover7 closed this Aug 4, 2018
targos pushed a commit that referenced this pull request Aug 6, 2018
@mlrv @targos
http,tls: name anonymous callbacks
1ca46ab
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
@rvagg rvagg mentioned this pull request Aug 13, 2018
Release proposal: v10.9.0 #22295
Merged
This was referenced Aug 16, 2018
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-android-nodejs#230
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-nodejs#215
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-android-nodejs#231
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-nodejs#216
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-android-nodejs#232
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-nodejs#217
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-android-nodejs#233
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-nodejs#218
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-android-nodejs#234
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-nodejs#219
Closed
@snyk-bot snyk-bot mentioned this pull request Mar 18, 2020
[Snyk] Upgrade: gatsby, gatsby-image, gatsby-plugin-catch-links, gatsby-plugin-manifest, gatsby-plugin-no-sourcemaps, gatsby-plugin-offline, gatsby-plugin-react-helmet, gatsby-plugin-sharp, gatsby-plugin-styled-components, gatsby-remark-autolink-headers, gatsby-remark-prismjs, gatsby-source-filesystem, gatsby-transformer-remark O330oei/node#3
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Trott Trott Trott left review comments
@jasnell jasnell jasnell approved these changes
@benjamingr benjamingr benjamingr approved these changes
@lpinca lpinca lpinca approved these changes
@BridgeAR BridgeAR BridgeAR approved these changes
@trivikr trivikr trivikr approved these changes
+3 more reviewers
@apapirovski apapirovski apapirovski approved these changes
@maclover7 maclover7 maclover7 approved these changes
@starkwang starkwang starkwang approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. http Issues and PRs related to the http subsystem. stream Issues and PRs related to Node.js streams. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

12 participants

@mlrv @trivikr @benjamingr @Trott @maclover7 @apapirovski @jasnell @lpinca @BridgeAR @starkwang @addaleax @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.