| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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 nodejs#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
Sorry, something went wrong.
There was a problem hiding this comment.
Agreed, will update PR shortly.
EDIT: Done.
Sorry, something went wrong.
Update based on PR feedback. nodejs#7378 (comment)
Sorry, something went wrong.
|
LGTM. Nothing else in _http_* emits 'finish' in the other code paths of that function, so it should be all good. 👍 |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
/cc @nodejs/http |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
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>
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>
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
http
( Specifically _http_outgoing.js: OutgoingMessage.prototype.end method )
Description of change