Skip to content
Closed
Changes from 1 commit
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
Next Next commit
repl: name anonymous functions in repl module
name anonymous functions in repl module
the changes are related to Ref: #8913
regarding the naming of just the inline anonymous
functions that are not assigned to a variable
  • Loading branch information
pvsousalima committed Oct 29, 2016
commit ffcb0386eb485060c6fd5cbe608256ec882224bc
14 changes: 7 additions & 7 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ function REPLServer(prompt,

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

self._domain.on('error', function(e) {
self._domain.on('error', function debugDomainError(e) {
debug('domain error');
const top = replMap.get(self);
internalUtil.decorateErrorStack(e);
Expand Down Expand Up @@ -436,13 +436,13 @@ function REPLServer(prompt,
};
}

self.on('close', function() {
self.on('close', function emitExit() {
self.emit('exit');
});

var sawSIGINT = false;
var sawCtrlD = false;
self.on('SIGINT', function() {
self.on('SIGINT', function onSigInt() {
var empty = self.line.length === 0;
self.clearLine();
self.turnOffEditorMode();
Expand All @@ -465,7 +465,7 @@ function REPLServer(prompt,
self.displayPrompt();
});

self.on('line', function(cmd) {
self.on('line', function onLine(cmd) {
debug('line %j', cmd);
sawSIGINT = false;

Expand Down Expand Up @@ -586,7 +586,7 @@ function REPLServer(prompt,
}
});

self.on('SIGCONT', function() {
self.on('SIGCONT', function onSigCont() {
if (self.editorMode) {
self.outputStream.write(`${self._initialPrompt}.editor\n`);
self.outputStream.write(
Expand Down Expand Up @@ -951,7 +951,7 @@ function complete(line, callback) {
addStandardGlobals(completionGroups, filter);
completionGroupsLoaded();
} else {
this.eval('.scope', this.context, 'repl', function(err, globals) {
this.eval('.scope', this.context, 'repl', function doEvalOnContext(err, globals) {
if (err || !Array.isArray(globals)) {
addStandardGlobals(completionGroups, filter);
} else if (Array.isArray(globals[0])) {
Expand All @@ -968,7 +968,7 @@ function complete(line, callback) {
}
} else {
const evalExpr = `try { ${expr} } catch (e) {}`;
this.eval(evalExpr, this.context, 'repl', function(e, obj) {
this.eval(evalExpr, this.context, 'repl', function doEvalOnContext(e, obj) {
// if (e) console.log(e);

if (obj != null) {
Expand Down