-
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
lib: changed bootstrap/node.js to arrow function #24625
lib: changed bootstrap/node.js to arrow function #24625
Conversation
lib/internal/bootstrap/node.js
Outdated
@@ -389,13 +389,13 @@ | |||
const util = NativeModule.require('util'); | |||
|
|||
function makeGetter(name) { | |||
return util.deprecate(function() { | |||
return util.deprecate(() => { | |||
return this; |
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.
Some of these functions use this
, so I think converting them to an arrow function would break them?
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.
thanks! I'll change that part back to function
94271d4
to
cfd900d
Compare
lib/internal/bootstrap/node.js
Outdated
@@ -395,7 +395,7 @@ | |||
} | |||
|
|||
function makeSetter(name) { | |||
return util.deprecate(function(value) { | |||
return util.deprecate((value) => { | |||
Object.defineProperty(this, name, { |
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.
this
is used here so that we should not change here, should we?
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.
sorry, missed that part. I'll change that part back to function as well
Landed in 0f18a40 |
PR-URL: nodejs#24625 Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Thanks for the contribution! 🎉 (If you're interested in other possible contributions to Node.js but don't have a good idea of where to start looking, some ideas are posted at https://www.nodetodo.org/next-steps/.) |
PR-URL: #24625 Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com>
PR-URL: nodejs#24625 Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com>
PR-URL: #24625 Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com>
PR-URL: #24625 Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Checklist
fix function declarations to arrow functions in lib/internal/bootstrap/node.js
make -j4 test
(UNIX), orvcbuild test
(Windows) passes