joyent/node — pull request #3621 by mmalecki (2012-07-03 02:18:27+00:00)
Title: repl: fix crashes when buffering command

Wrong order of operands was causing problems while trying to use command
buffering:

> {
... a: 3,
...

repl.js:284
if (cmd.trim().match(/^npm /) && !self.bufferedCommand) {
^
TypeError: Cannot call method 'trim' of undefined
at finish (repl.js:284:17)
at REPLServer.self.eval (repl.js:118:5)
at rli.on.e (repl.js:260:20)
at REPLServer.self.eval (repl.js:118:5)
at Interface. (repl.js:250:12)
at Interface.EventEmitter.emit (events.js:88:17)
at Interface._onLine (readline.js:183:10)
at Interface._line (readline.js:502:8)
at Interface._ttyWrite (readline.js:720:14)
at ReadStream. (readline.js:105:12)