Skip to content

Commit

Permalink
http: named anonymous functions in repl.js
Browse files Browse the repository at this point in the history
  • Loading branch information
babamihai committed Jul 11, 2018
1 parent 8174d0c commit 268b763
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ REPLServer.prototype.setPrompt = function setPrompt(prompt) {
};

REPLServer.prototype.turnOffEditorMode = util.deprecate(
function() { _turnOffEditorMode(this); },
function deprecateCB() { _turnOffEditorMode(this); },
'REPLServer.turnOffEditorMode() is deprecated',
'DEP0078');

Expand Down Expand Up @@ -1401,7 +1401,7 @@ function _turnOffEditorMode(repl) {
function defineDefaultCommands(repl) {
repl.defineCommand('break', {
help: 'Sometimes you get stuck, this gets you out',
action: function() {
action: function defineDefaultCommandsAction() {
this.clearBufferedCommand();
this.displayPrompt();
}
Expand All @@ -1415,7 +1415,7 @@ function defineDefaultCommands(repl) {
}
repl.defineCommand('clear', {
help: clearMessage,
action: function() {
action: function defineCommandClearAction() {
this.clearBufferedCommand();
if (!this.useGlobal) {
this.outputStream.write('Clearing context...\n');
Expand All @@ -1427,14 +1427,14 @@ function defineDefaultCommands(repl) {

repl.defineCommand('exit', {
help: 'Exit the repl',
action: function() {
action: function defineCommandExitAction() {
this.close();
}
});

repl.defineCommand('help', {
help: 'Print this help message',
action: function() {
action: function defineCommandHelpAction() {
const names = Object.keys(this.commands).sort();
const longestNameLength = names.reduce(
(max, name) => Math.max(max, name.length),
Expand All @@ -1453,7 +1453,7 @@ function defineDefaultCommands(repl) {

repl.defineCommand('save', {
help: 'Save all evaluated commands in this REPL session to a file',
action: function(file) {
action: function defineCommandSaveAction(file) {
try {
fs.writeFileSync(file, this.lines.join('\n') + '\n');
this.outputStream.write('Session saved to: ' + file + '\n');
Expand All @@ -1466,7 +1466,7 @@ function defineDefaultCommands(repl) {

repl.defineCommand('load', {
help: 'Load JS from a file into the REPL session',
action: function(file) {
action: function defineDefineCommandLoadAction(file) {
try {
var stats = fs.statSync(file);
if (stats && stats.isFile()) {
Expand Down

0 comments on commit 268b763

Please sign in to comment.