Skip to content

Commit 18f49ce

Browse files
committed
http: named anonymous functions in repl.js
refs: nodejs#8913
1 parent c22cdfb commit 18f49ce

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
@@ -880,7 +880,7 @@ REPLServer.prototype.setPrompt = function setPrompt(prompt) {
880880
};
881881

882882
REPLServer.prototype.turnOffEditorMode = util.deprecate(
883-
function() { _turnOffEditorMode(this); },
883+
function deprecateCB() { _turnOffEditorMode(this); },
884884
'REPLServer.turnOffEditorMode() is deprecated',
885885
'DEP0078');
886886

@@ -1401,7 +1401,7 @@ function _turnOffEditorMode(repl) {
14011401
function defineDefaultCommands(repl) {
14021402
repl.defineCommand('break', {
14031403
help: 'Sometimes you get stuck, this gets you out',
1404-
action: function() {
1404+
action: function defineDefaultCommandsAction() {
14051405
this.clearBufferedCommand();
14061406
this.displayPrompt();
14071407
}
@@ -1415,7 +1415,7 @@ function defineDefaultCommands(repl) {
14151415
}
14161416
repl.defineCommand('clear', {
14171417
help: clearMessage,
1418-
action: function() {
1418+
action: function defineCommandClearAction() {
14191419
this.clearBufferedCommand();
14201420
if (!this.useGlobal) {
14211421
this.outputStream.write('Clearing context...\n');
@@ -1427,14 +1427,14 @@ function defineDefaultCommands(repl) {
14271427

14281428
repl.defineCommand('exit', {
14291429
help: 'Exit the repl',
1430-
action: function() {
1430+
action: function defineCommandExitAction() {
14311431
this.close();
14321432
}
14331433
});
14341434

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

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

14671467
repl.defineCommand('load', {
14681468
help: 'Load JS from a file into the REPL session',
1469-
action: function(file) {
1469+
action: function defineDefineCommandLoadAction(file) {
14701470
try {
14711471
var stats = fs.statSync(file);
14721472
if (stats && stats.isFile()) {

0 commit comments

Comments
 (0)