net: refactor self=this to arrow functions#5857
Closed
benjamingr wants to merge 2 commits intonodejs:masterfrom
Closed
net: refactor self=this to arrow functions#5857benjamingr wants to merge 2 commits intonodejs:masterfrom
benjamingr wants to merge 2 commits intonodejs:masterfrom
Conversation
Refactor unused self=this code to code without without this pattern making it more consistent with the rest of our code. PR-URL: Reviewed-By: Reviewed-By:
lib/net.js
Outdated
| if (this.destroyed) { | ||
| debug('already destroyed, fire error callbacks'); | ||
| fireErrorCallbacks(); | ||
| fireErrorCallbacks.call(this); |
Contributor
There was a problem hiding this comment.
What about just passing this to the function and have self be the parameter name?
Member
Author
There was a problem hiding this comment.
That's actually probably a better idea. Thanks.
Contributor
|
One nit but otherwise LGTM. |
lib/net.js
Outdated
| // is called within callbacks | ||
| this.destroyed = true; | ||
| fireErrorCallbacks(); | ||
| fireErrorCallbacks.call(this); |
Member
Author
|
Addressed nit, thanks. |
Contributor
|
LGTM |
3 similar comments
Contributor
|
LGTM |
Contributor
|
LGTM |
Member
|
LGTM |
benjamingr
added a commit
that referenced
this pull request
Mar 27, 2016
Refactor unused self=this code to code without without this pattern making it more consistent with the rest of our code. PR-URL: #5857 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Roman Klauke <romankl@users.noreply.github.com>
Member
Author
|
Landed in a15906c , thanks reviewers :) |
Contributor
|
This is not applying cleanly to v5.x. Could you backport it please? |
MylesBorins
pushed a commit
that referenced
this pull request
Apr 5, 2016
Refactor unused self=this code to code without without this pattern making it more consistent with the rest of our code. PR-URL: #5857 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Roman Klauke <romankl@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Affected core subsystem(s)
net
Description of change
Refactor unused
self=thiscode to code without without this patternmaking it more consistent with the rest of our code.
There were PRs to do this code-base wide but they all seem to have stalled so I figured I'd do this in the least objectionable way one change at a time.
CI: https://ci.nodejs.org/job/node-test-pull-request/2037/console