Skip to content

Commit

Permalink
repl: use _REPL_ in user-facing text
Browse files Browse the repository at this point in the history
User-facing error messages should use _REPL_ for the general REPL and
not _repl_ which should be reserved for referring to the module itself,
etc. _REPL_ is an acronym, so it should be capitalized, as it generally
is in documentation in other technologies, and is usually in our own
documentation. This fixes a few inconsistent usages in lib/repl.js.

PR-URL: #34643
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
Trott authored and addaleax committed Aug 8, 2020
1 parent e146686 commit 276e298
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

/* A repl library that you can include in your own code to get a runtime
/* A REPL library that you can include in your own code to get a runtime
* interface to your program.
*
* const repl = require("repl");
Expand Down Expand Up @@ -591,7 +591,7 @@ function REPLServer(prompt,
'module';
if (StringPrototypeIncludes(e.message, importErrorStr)) {
e.message = 'Cannot use import statement inside the Node.js ' +
'repl, alternatively use dynamic import';
'REPL, alternatively use dynamic import';
e.stack = e.stack.replace(/SyntaxError:.*\n/,
`SyntaxError: ${e.message}\n`);
}
Expand Down Expand Up @@ -814,7 +814,7 @@ function REPLServer(prompt,

if (e && !self[kBufferedCommandSymbol] && cmd.trim().startsWith('npm ')) {
self.output.write('npm should be run outside of the ' +
'node repl, in your normal shell.\n' +
'node REPL, in your normal shell.\n' +
'(Press Control-D to exit.)\n');
self.displayPrompt();
return;
Expand Down Expand Up @@ -1521,7 +1521,7 @@ function defineDefaultCommands(repl) {
});

repl.defineCommand('exit', {
help: 'Exit the repl',
help: 'Exit the REPL',
action: function() {
this.close();
}
Expand All @@ -1543,7 +1543,7 @@ function defineDefaultCommands(repl) {
this.output.write(line);
}
this.output.write('\nPress ^C to abort current expression, ' +
'^D to exit the repl\n');
'^D to exit the REPL\n');
this.displayPrompt();
}
});
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ const errorTests = [
{
send: 'npm install foobar',
expect: [
'npm should be run outside of the node repl, in your normal shell.',
'npm should be run outside of the node REPL, in your normal shell.',
'(Press Control-D to exit.)'
]
},
Expand Down Expand Up @@ -453,7 +453,7 @@ const errorTests = [
/\.load/,
/\.save/,
'',
'Press ^C to abort current expression, ^D to exit the repl',
'Press ^C to abort current expression, ^D to exit the REPL',
/'thefourtheye'/
]
},
Expand Down

0 comments on commit 276e298

Please sign in to comment.