Uh oh!
There was an error while loading. Please reload this page.
REPL bug fixes - #2163
Conversation
Fishrock123
commented
Jul 12, 2015
24f85ef to
498eccbCompareFishrock123
commented
Jul 16, 2015
thefourtheye
commented
Jul 17, 2015
None of the CI failures are because of this change. Yay :-) |
There was a problem hiding this comment.
I suggest also trying \r and other related characters.
Fishrock123
commented
Jul 21, 2015
The other three LGTM, but maybe if @chrisdickinson could review just thefourtheye@498eccb / r |
Fishrock123
commented
Jul 21, 2015
Also @thefourtheye anywhere you modify or add a variable that could be a |
There was a problem hiding this comment.
Just yesterday I learned about String.prototype.trimLeft() and String.prototype.trimRight(). These are nonstandard, but there's some discussion about standardizing them on the es-discuss mailing list, so I think we're safe to use them. Also, on the first case, let's use standard String.prototype.trim() :)
8cb8083 to
ccece25Comparethefourtheye
commented
Jul 22, 2015
@Fishrock123@silverwind I addressed all the review comments (no exceptions, I addressed them all). PTAL now :-) PS: I rebased with |
When an invalid REPL keyword is used, we actually print `undefined` as well in the console. > process.version 'v2.3.4' > .invalid_repl_command Invalid REPL keyword undefined > This patch prevents printing `undefined` in this case. > process.version 'v2.3.5-pre' > .invalid_repl_command Invalid REPL keyword >
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 >
ccece25 to
aac19e2CompareThere was a problem hiding this comment.
@Fishrock123 Other places in the test also use \n only and they seem to work fine in Windows also (we never had any failures in Win32 land because of this, right?) Moreover the test itself is called as unix_tests. Should we really change this?
There was a problem hiding this comment.
Hmm, I'm not really sure, perhaps it should be in it's own test bit. I guess it's not really necessary.
Fishrock123
commented
Jul 22, 2015
Two nits. LGTM. Please re-run the CI after you add |
As it is, REPL doesn't honour the line continuation feature very well. This patch 1. keeps track of the beginning of the string literals and if they don't end or current line doesn't end with line continuation, then error out. 2. monitors if the line continuation character is used without the string literal and errors out if that happens.
In REPL, if we try to evaluate an empty line, we get `undefined`. > process.version 'v2.3.4' > undefined > undefined > This patch prevents `undefined` from printing if the string is empty. > process.version 'v2.3.5-pre' > > >
aac19e2 to
b54f153CompareFishrock123
commented
Jul 23, 2015
Here's a new CI then. Land if it's green(-ish). https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/187/ |
thefourtheye
commented
Jul 24, 2015
@Fishrock123 Except the win2008r2 (which fails with Edit: The problematic win2008r2 CI job link |
Fishrock123
commented
Jul 24, 2015
@thefourtheye yeah do the thing, that just looks like jenkins hasn't had enough coffee or something. Edit: looks like the windows2008r2-1 machine is having issues. |
When an invalid REPL keyword is used, we actually print `undefined` as well in the console. > process.version 'v2.3.4' > .invalid_repl_command Invalid REPL keyword undefined > This patch prevents printing `undefined` in this case. > process.version 'v2.3.5-pre' > .invalid_repl_command Invalid REPL keyword > PR-URL: #2163 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
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: #2163 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
As it is, REPL doesn't honour the line continuation feature very well. This patch 1. keeps track of the beginning of the string literals and if they don't end or current line doesn't end with line continuation, then error out. 2. monitors if the line continuation character is used without the string literal and errors out if that happens. PR-URL: #2163 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
In REPL, if we try to evaluate an empty line, we get `undefined`. > process.version 'v2.3.4' > undefined > undefined > This patch prevents `undefined` from printing if the string is empty. > process.version 'v2.3.5-pre' > > > PR-URL: #2163 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
thefourtheye
commented
Jul 24, 2015
Thanks @Fishrock123 :-) Landed at afd7e37, 81ea52a, 30edb5a and 77fa385 |
Tweak the better empty line handling introduced in nodejs#2163 so that empty lines are still passed to the eval function. This is required for the debugger to repeat the last command on an empty line. Fixes: nodejs#6010
There are four bug fixes.
1. Better line continuation feature
As it is, REPL doesn't honour the line continuation feature very well.
This patch
don't end or current line doesn't end with line continuation, then
error out.
string literal and errors out if that happens.
2. Removing
undefinedwhen unknown REPL command is usedWhen an invalid REPL keyword is used, we actually print
undefinedaswell in the console.
This patch prevents printing
undefinedin this case.3. preventing REPL crash with inherited properties
When an inherited property is used as a REPL keyword, the REPL crashes.
This patch makes the internal
commandsobject inherit fromnullsothat there will be no inherited properties.
4. Better empty line handling
In REPL, if we try to evaluate an empty line, we get
undefined.This patch prevents
undefinedfrom printing if the string is empty.