Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repl: preventing REPL crash with inherited properties
When an inherited property is used as a REPL keyword, the REPL crashes. ➜ Desktop iojs > process.version 'v2.3.4' > .toString readline.js:913 stream[ESCAPE_DECODER].next(r[i]); ^ TypeError: Cannot read property 'call' of undefined at REPLServer.parseREPLKeyword (repl.js:746:15) at REPLServer.<anonymous> (repl.js:284:16) at emitOne (events.js:77:13) at REPLServer.emit (events.js:169:7) at REPLServer.Interface._onLine (readline.js:210:10) at REPLServer.Interface._line (readline.js:549:8) at REPLServer.Interface._ttyWrite (readline.js:826:14) at ReadStream.onkeypress (readline.js:105:10) at emitTwo (events.js:87:13) at ReadStream.emit (events.js:172:7) ➜ Desktop This patch makes the internal `commands` object inherit from `null` so that there will be no inherited properties. > process.version 'v2.3.5-pre' > .toString Invalid REPL keyword > PR-URL: nodejs#2163 Reviewed-By: Jeremiah Senkpiel <[email protected]>
- Loading branch information