repl: allow leading period in multiline input#3835
repl: allow leading period in multiline input#3835Zirak wants to merge 1 commit intonodejs:masterfrom
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 ]
|
Actually, this is intentional. Let's say user types in something invalid, they can always type |
|
Oh yes, this preserves the current behaviour, just additionally allowing for chaining. So the following still works: > ([0, 1, 2]
... .break
> |
|
Oh, that's right. REPL command check happens before this. LGTM then. |
|
LGTM |
|
marked semver-minor since this represents a new capability in the REPL as opposed to a fix. |
|
@jasnell We can argue that its a bug fix, as |
|
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. |
|
@nodejs/collaborators ... some additional review on this one would be appreciated. thank you! |
|
CI: https://ci.nodejs.org/job/node-test-pull-request/846/ Our repl tests are pretty good, Rubber-Stamp LGTM if it works. |
|
failing tests look unrelated. gtg. |
|
@Zirak your git info is |
|
@Fishrock123 On this part of the internet I go as Zirak. |
|
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>
|
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: