Uh oh!
There was an error while loading. Please reload this page.
Http: Improve finish() callback and code legibility (Fixes #7295) - #7378
Closed
originalfoo wants to merge 4 commits into
Closed
Http: Improve finish() callback and code legibility (Fixes #7295)#7378originalfoo wants to merge 4 commits into
finish() callback and code legibility (Fixes #7295)#7378originalfoo wants to merge 4 commits into
Conversation
Take advantage of arrow function lexical `this` to avoid defining a `self = this` var which was only used once.
Code relating to the `finish` event was split in to two areas of the parent function. Gathered it together to clarify association within the script. Fixesnodejs#7295
per jshint's request!
| if (typeof callback === 'function') | ||
| this.once('finish', callback); | ||
| var finish = () => { |
There was a problem hiding this comment.
I think if better if in places like this you use const instead var
ContributorAuthor
There was a problem hiding this comment.
Agreed, will update PR shortly.
EDIT: Done.
Update based on PR feedback. nodejs#7378 (comment)
mscdex
commented
Jun 23, 2016
Contributor
Member
LGTM. Nothing else in |
mscdex
commented
Jun 23, 2016
Contributor
LGTM |
mscdex
commented
Jun 23, 2016
Contributor
/cc @nodejs/http |
indutny
commented
Jun 23, 2016
Member
LGTM |
1 similar comment
cjihrig
commented
Jun 23, 2016
Contributor
LGTM |
jasnell
commented
Jun 27, 2016
Member
LGTM |
jasnell pushed a commit
that referenced
this pull request
Jun 27, 2016
Take advantage of arrow function lexical `this` to avoid defining a `self = this` var which was only used once. Code relating to the `finish` event was split in to two areas of the parent function. Gathered it together to clarify association within the script. Fixes: #7295 PR-URL: #7378 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell
commented
Jun 27, 2016
Member
Landed in 3c09d1b |
Fishrock123 pushed a commit
that referenced
this pull request
Jul 5, 2016
Take advantage of arrow function lexical `this` to avoid defining a `self = this` var which was only used once. Code relating to the `finish` event was split in to two areas of the parent function. Gathered it together to clarify association within the script. Fixes: #7295 PR-URL: #7378 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
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 freeto 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.
Checklist
make -j4 test(UNIX) orvcbuild test nosign(Windows) passesAffected core subsystem(s)
http
( Specifically
_http_outgoing.js:OutgoingMessage.prototype.endmethod )Description of change
this.finishevent together to improve code clarity.this? #7295 for further details.