Skip to content

Commit 071836a

Browse files
pvsousalimaevanlucas
authored andcommitted
repl: name anonymous functions
the changes are related to #8913 regarding the naming of just the inline anonymous functions that are not assigned to a variable PR-URL: #9356 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
1 parent d09eb9c commit 071836a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/repl.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ function REPLServer(prompt,
354354

355355
self.eval = self._domain.bind(eval_);
356356

357-
self._domain.on('error', function(e) {
357+
self._domain.on('error', function debugDomainError(e) {
358358
debug('domain error');
359359
const top = replMap.get(self);
360360
internalUtil.decorateErrorStack(e);
@@ -436,13 +436,13 @@ function REPLServer(prompt,
436436
};
437437
}
438438

439-
self.on('close', function() {
439+
self.on('close', function emitExit() {
440440
self.emit('exit');
441441
});
442442

443443
var sawSIGINT = false;
444444
var sawCtrlD = false;
445-
self.on('SIGINT', function() {
445+
self.on('SIGINT', function onSigInt() {
446446
var empty = self.line.length === 0;
447447
self.clearLine();
448448
self.turnOffEditorMode();
@@ -465,7 +465,7 @@ function REPLServer(prompt,
465465
self.displayPrompt();
466466
});
467467

468-
self.on('line', function(cmd) {
468+
self.on('line', function onLine(cmd) {
469469
debug('line %j', cmd);
470470
sawSIGINT = false;
471471

@@ -586,7 +586,7 @@ function REPLServer(prompt,
586586
}
587587
});
588588

589-
self.on('SIGCONT', function() {
589+
self.on('SIGCONT', function onSigCont() {
590590
if (self.editorMode) {
591591
self.outputStream.write(`${self._initialPrompt}.editor\n`);
592592
self.outputStream.write(
@@ -951,7 +951,7 @@ function complete(line, callback) {
951951
addStandardGlobals(completionGroups, filter);
952952
completionGroupsLoaded();
953953
} else {
954-
this.eval('.scope', this.context, 'repl', function(err, globals) {
954+
this.eval('.scope', this.context, 'repl', function ev(err, globals) {
955955
if (err || !Array.isArray(globals)) {
956956
addStandardGlobals(completionGroups, filter);
957957
} else if (Array.isArray(globals[0])) {
@@ -968,7 +968,7 @@ function complete(line, callback) {
968968
}
969969
} else {
970970
const evalExpr = `try { ${expr} } catch (e) {}`;
971-
this.eval(evalExpr, this.context, 'repl', function(e, obj) {
971+
this.eval(evalExpr, this.context, 'repl', function doEval(e, obj) {
972972
// if (e) console.log(e);
973973

974974
if (obj != null) {

0 commit comments

Comments
 (0)