-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http: use arrow function to take advantage of lexical this
?
#7295
Labels
http
Issues or PRs related to the http subsystem.
Comments
We'd be happy to review a pull request if you'd like to make one. :) |
Will do 👍 |
originalfoo
added a commit
to originalfoo/node
that referenced
this issue
Jun 23, 2016
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
2 tasks
PR sent :) |
Fishrock123
pushed a commit
that referenced
this issue
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 <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
OutgoingMessage.prototype.end
there's aself
var that's only used once for thefinish()
function - would it be better to use an arrow function instead?Current code: https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js#L549
Proposed change:
Also, as the
finish()
function isn't used until the code around L584, would it be worth moving the function closer to where it's used (along with thecallback
check) to aid code clarity?The text was updated successfully, but these errors were encountered: