Browse Source

repl: name anonymous functions

the changes are related to https://github.com/nodejs/node/issues/8913
regarding the naming of just the inline anonymous
functions that are not assigned to a variable

PR-URL: https://github.com/nodejs/node/pull/9356
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
v6
Pedro Victor 8 years ago
committed by Roman Reiss
parent
commit
e658f5b066
No known key found for this signature in database GPG Key ID: 2E62B41C93869443
  1. 14
      lib/repl.js

14
lib/repl.js

@ -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);
@ -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();
@ -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;
@ -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(
@ -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 ev(err, globals) {
if (err || !Array.isArray(globals)) {
addStandardGlobals(completionGroups, filter);
} else if (Array.isArray(globals[0])) {
@ -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 doEval(e, obj) {
// if (e) console.log(e);
if (obj != null) {

Loading…
Cancel
Save