Skip to content
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

Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
// To allow people to extend Node in different ways, this hook allows
// one to drop a file lib/_third_party_main.js into the build
// directory which will be executed instead of Node's normal loading.
process.nextTick(function() {
process.nextTick(() => {
NativeModule.require('_third_party_main');
});
} else if (process.argv[1] === 'inspect' || process.argv[1] === 'debug') {
Expand All @@ -251,7 +251,7 @@
}

// Start the debugger agent.
process.nextTick(function() {
process.nextTick(() => {
NativeModule.require('internal/deps/node-inspect/lib/_inspect').start();
});

Expand Down Expand Up @@ -304,14 +304,14 @@
if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
// REPL
const cliRepl = NativeModule.require('internal/repl');
cliRepl.createInternalRepl(process.env, function(err, repl) {
cliRepl.createInternalRepl(process.env, (err, repl) => {
if (err) {
throw err;
}
repl.on('exit', function() {
repl.on('exit', () => {
if (repl._flushing) {
repl.pause();
return repl.once('flushHistory', function() {
return repl.once('flushHistory', () => {
process.exit();
});
}
Expand All @@ -328,11 +328,11 @@
process.stdin.setEncoding('utf8');

let code = '';
process.stdin.on('data', function(d) {
process.stdin.on('data', (d) => {
code += d;
});

process.stdin.on('end', function() {
process.stdin.on('end', () => {
if (process._syntax_check_only != null) {
checkScriptSyntax(code, '[stdin]');
} else {
Expand Down Expand Up @@ -395,7 +395,7 @@
}

function makeSetter(name) {
return util.deprecate(function(value) {
return util.deprecate((value) => {
Object.defineProperty(this, name, {
Copy link
Contributor

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?

Copy link
Contributor Author

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

configurable: true,
writable: true,
Expand Down Expand Up @@ -567,7 +567,7 @@
emitAfter
} = NativeModule.require('internal/async_hooks');

process._fatalException = function(er) {
process._fatalException = (er) => {
// It's possible that defaultTriggerAsyncId was set for a constructor
// call that threw and was never cleared. So clear it now.
clearDefaultTriggerAsyncId();
Expand Down