-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
fs: refactor self=this to arrow #4831
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
Conversation
Refactor a self=this pattern to use arrow functions.
@silverwind I don't understand the CI output here. Maybe it needs to be re-run? Is it normal for a run to take 5 hours? |
I think the CI is currently stuck on the ARM build bots. ARM runs usually take around an hour, not five. @nodejs/build might need to give those RPis a nudge. |
Looks like this needs some work:
Don't forget to run |
I did 0_0', I'll look into what went wrong tomorrow. Thanks. |
var self = this; | ||
|
||
const close = (fd) => { | ||
fs.close(fd || this.fd, function(er) { |
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.
Should probably also make this an arrow for the fix :)
It looks like we quite a few of these arrow function PR's. Some are working with each other, some against. Might be worth landing/rejecting a few of those PR's so precedence is established. I foresee a few more of these kind of PR's. |
Yeah, a general policy regarding arrow functions would be nice, at least for Once cc: @nodejs/ctc |
@silverwind I'm for producing the least amount of work and keeping the code consistent. I don't mind working on a full blown PR that refactors all |
@benjamingr, @silverwind I've already got one from a few months ago, #3816 It touches almost every file in |
@tflanagan oh, I totally missed that one. Will review later. |
Roger, I'm just looking to help. If there is already someone willing to do the dirty work by all means let them do it for me :) |
This PR refactors
self = this
pattern usages to arrow functions in several places in the code.In some places, arrow functions were already used and the
self = this
was simply redundant.