FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

repl: allow leading period in multiline input by Zirak · Pull Request #3835 · nodejs/node · GitHub

/ node Public

repl: allow leading period in multiline input - #3835

Closed
Zirak wants to merge 1 commit into
nodejs:masterfrom
Zirak:repl-multiline-command
Closed

repl: allow leading period in multiline input#3835
Zirak wants to merge 1 commit into
nodejs:masterfrom
Zirak:repl-multiline-command

Conversation

Zirak commented Nov 15, 2015

Copy link
Copy Markdown
Contributor

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 ]

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 added the repl Issues and PRs related to the REPL subsystem. label Nov 15, 2015

Copy link
Copy Markdown
Contributor

Actually, this is intentional. Let's say user types in something invalid, they can always type .break.

Zirak commented Nov 15, 2015

Copy link
Copy Markdown
Contributor Author

Oh yes, this preserves the current behaviour, just additionally allowing for chaining. So the following still works:

> ([0, 1, 2]
... .break
> 

Copy link
Copy Markdown
Contributor

Oh, that's right. REPL command check happens before this. LGTM then.

jasnell commented Nov 16, 2015

Copy link
Copy Markdown
Member

LGTM

jasnell added the semver-minor PRs that contain new features and should be released in the next minor version. label Nov 16, 2015

jasnell commented Nov 16, 2015

Copy link
Copy Markdown
Member

marked semver-minor since this represents a new capability in the REPL as opposed to a fix.

Copy link
Copy Markdown
Contributor

@jasnell We can argue that its a bug fix, as ([0, 1, 2]\n .map(x => x + 1)) will throw Invalid REPL command right now. But, as 5.1.0 is around the corner, semver-minor is okay I guess.

jasnell commented Nov 16, 2015

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member

@nodejs/collaborators ... some additional review on this one would be appreciated. thank you!

Copy link
Copy Markdown
Contributor

CI: https://ci.nodejs.org/job/node-test-pull-request/846/

Our repl tests are pretty good, Rubber-Stamp LGTM if it works.

Copy link
Copy Markdown
Contributor

failing tests look unrelated. gtg.

Copy link
Copy Markdown
Contributor

@Zirak your git info is Author: Zirak <zirakertan@gmail.com> Are you ok with that? I can't tell if that's just a username or not. Usually we use full names, but you are not required to if you'd rather be known as something else. :)

Zirak commented Dec 1, 2015

Copy link
Copy Markdown
Contributor Author

@Fishrock123 On this part of the internet I go as Zirak.

Copy link
Copy Markdown
Contributor

Ok, sounds good. Merging. :)

Fishrock123 pushed a commit that referenced this pull request Dec 2, 2015
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>

Copy link
Copy Markdown
Contributor

Thanks, landed in 451254e!

Fishrock123 closed this Dec 2, 2015
rvagg pushed a commit that referenced this pull request Dec 5, 2015
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>
scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

repl Issues and PRs related to the REPL subsystem. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL