Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
repl: remove a unnecessary concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkie authored and tjfontaine committed Feb 18, 2014
1 parent 3ae0b17 commit c980280
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) {
// Check to see if a REPL keyword was used. If it returns true,
// display next prompt and return.
if (cmd && cmd.charAt(0) === '.' && isNaN(parseFloat(cmd))) {
var matches = cmd.match(/^(\.[^\s]+)\s*(.*)$/);
var matches = cmd.match(/^\.([^\s]+)\s*(.*)$/);
var keyword = matches && matches[1];
var rest = matches && matches[2];
if (self.parseREPLKeyword(keyword, rest) === true) {
Expand Down Expand Up @@ -707,7 +707,7 @@ REPLServer.prototype.defineCommand = function(keyword, cmd) {
} else if (!util.isFunction(cmd.action)) {
throw new Error('bad argument, action must be a function');
}
this.commands['.' + keyword] = cmd;
this.commands[keyword] = cmd;
};

REPLServer.prototype.memory = function memory(cmd) {
Expand Down

0 comments on commit c980280

Please sign in to comment.