Uh oh!
There was an error while loading. Please reload this page.
repl: allow leading period in multiline input - #3835
Conversation
When writing multiline input, one can't chain function calls as if the lines begin with a period, since those are treated as REPL commands. Before: > ([0, 1, 2] ... .map(x => x + 1)) Invalid REPL keyword After: > ([0, 1, 2] ... .map(x => x + 1)) [ 1, 2, 3 ]
thefourtheye
commented
Nov 15, 2015
Actually, this is intentional. Let's say user types in something invalid, they can always type |
Zirak
commented
Nov 15, 2015
Oh yes, this preserves the current behaviour, just additionally allowing for chaining. So the following still works: >([0,1,2]....break> |
thefourtheye
commented
Nov 15, 2015
Oh, that's right. REPL command check happens before this. LGTM then. |
jasnell
commented
Nov 16, 2015
LGTM |
jasnell
commented
Nov 16, 2015
marked semver-minor since this represents a new capability in the REPL as opposed to a fix. |
thefourtheye
commented
Nov 16, 2015
@jasnell We can argue that its a bug fix, as |
jasnell
commented
Nov 16, 2015
It's a... ahem.. minor... point ;-) It'll land in v5.x soon either way. It's just not likely to be something that would land in v4.x. |
jasnell
commented
Nov 18, 2015
@nodejs/collaborators ... some additional review on this one would be appreciated. thank you! |
Fishrock123
commented
Nov 25, 2015
CI: https://ci.nodejs.org/job/node-test-pull-request/846/ Our repl tests are pretty good, Rubber-Stamp LGTM if it works. |
trevnorris
commented
Nov 30, 2015
failing tests look unrelated. gtg. |
Fishrock123
commented
Dec 1, 2015
@Zirak your git info is |
Zirak
commented
Dec 1, 2015
@Fishrock123 On this part of the internet I go as Zirak. |
Fishrock123
commented
Dec 2, 2015
Ok, sounds good. Merging. :) |
When writing multiline input, one can't chain function calls as if the lines begin with a period, since those are treated as REPL commands. Before: > ([0, 1, 2] ... .map(x => x + 1)) Invalid REPL keyword After: > ([0, 1, 2] ... .map(x => x + 1)) [ 1, 2, 3 ] PR-URL: #3835 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Fishrock123
commented
Dec 2, 2015
Thanks, landed in 451254e! |
When writing multiline input, one can't chain function calls as if the lines begin with a period, since those are treated as REPL commands. Before: > ([0, 1, 2] ... .map(x => x + 1)) Invalid REPL keyword After: > ([0, 1, 2] ... .map(x => x + 1)) [ 1, 2, 3 ] PR-URL: #3835 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
When writing multiline input, one can't chain function calls as if the lines begin with a period, since those are treated as REPL commands. Before: > ([0, 1, 2] ... .map(x => x + 1)) Invalid REPL keyword After: > ([0, 1, 2] ... .map(x => x + 1)) [ 1, 2, 3 ] PR-URL: nodejs#3835 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
When writing multiline input, one can't chain function calls as if the
lines begin with a period, since those are treated as REPL commands.
Before:
After: