repl: remove a unnecessary concatenation
This commit is contained in:
parent
3ae0b17c76
commit
c980280159
@ -247,7 +247,7 @@ function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) {
|
|||||||
// Check to see if a REPL keyword was used. If it returns true,
|
// Check to see if a REPL keyword was used. If it returns true,
|
||||||
// display next prompt and return.
|
// display next prompt and return.
|
||||||
if (cmd && cmd.charAt(0) === '.' && isNaN(parseFloat(cmd))) {
|
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 keyword = matches && matches[1];
|
||||||
var rest = matches && matches[2];
|
var rest = matches && matches[2];
|
||||||
if (self.parseREPLKeyword(keyword, rest) === true) {
|
if (self.parseREPLKeyword(keyword, rest) === true) {
|
||||||
@ -707,7 +707,7 @@ REPLServer.prototype.defineCommand = function(keyword, cmd) {
|
|||||||
} else if (!util.isFunction(cmd.action)) {
|
} else if (!util.isFunction(cmd.action)) {
|
||||||
throw new Error('bad argument, action must be a function');
|
throw new Error('bad argument, action must be a function');
|
||||||
}
|
}
|
||||||
this.commands['.' + keyword] = cmd;
|
this.commands[keyword] = cmd;
|
||||||
};
|
};
|
||||||
|
|
||||||
REPLServer.prototype.memory = function memory(cmd) {
|
REPLServer.prototype.memory = function memory(cmd) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user