Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repl: support standalone blocks #5581

Closed
wants to merge 1 commit into from

Conversation

princejwesley
Copy link
Contributor

Pull Request check-list

  • Does make -j8 test (UNIX) or vcbuild test nosign (Windows) pass with
    this change (including linting)?
  • Is the commit message formatted according to CONTRIBUTING.md?
  • If this change fixes a bug (or a performance problem), is a regression
    test (or a benchmark) included?
  • Is a documentation update included (if this change modifies
    existing APIs, or introduces new ones)?

Affected core subsystem(s)

repl

Description of change

Enable support for standalone block statements.
Fixes #5576.

node 🙈  git:(upstream  bare-block) ./node
> { var x = 3; console.log(x); }
3
undefined
> {}
{}
> { x:1, y:"why not", z: function() {} }
{ x: 1, y: 'why not', z: [Function] }
>

For the ambiguous inputs like { x }, the existing REPL behaviour (ES6 literal shorthand) is preserved (prefers expression over statement).

@mscdex mscdex added the repl Issues and PRs related to the REPL subsystem. label Mar 7, 2016
@jasnell jasnell added the semver-minor PRs that contain new features and should be released in the next minor version. label Mar 7, 2016
@jasnell
Copy link
Member

jasnell commented Mar 7, 2016

LGTM
/cc @nodejs/ctc

@evanlucas
Copy link
Contributor

LGTM if CI is happy (CI: https://ci.nodejs.org/job/node-test-pull-request/1875/)

@trevnorris
Copy link
Contributor

@jasnell you feel like landing this? :)

jasnell pushed a commit that referenced this pull request Mar 19, 2016
Enable support for standalone block statements.

```js
node 🙈 ₹ git:(upstream ⚡ bare-block) ./node
> { var x = 3; console.log(x); }
3
undefined
> {}
{}
> { x:1, y:"why not", z: function() {} }
{ x: 1, y: 'why not', z: [Function] }
>
```
For the ambiguous inputs like `{ x }`, the existing REPL
behaviour (ES6 literal shorthand) is preserved (prefers
expression over statement).

Fixes: #5576
PR-URL: #5581
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
@jasnell
Copy link
Member

jasnell commented Mar 19, 2016

Landed in a38d6ad
Added a bit more to the commit log.

@jasnell jasnell closed this Mar 19, 2016
evanlucas pushed a commit that referenced this pull request Mar 30, 2016
Enable support for standalone block statements.

```js
node 🙈 ₹ git:(upstream ⚡ bare-block) ./node
> { var x = 3; console.log(x); }
3
undefined
> {}
{}
> { x:1, y:"why not", z: function() {} }
{ x: 1, y: 'why not', z: [Function] }
>
```
For the ambiguous inputs like `{ x }`, the existing REPL
behaviour (ES6 literal shorthand) is preserved (prefers
expression over statement).

Fixes: #5576
PR-URL: #5581
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
evanlucas pushed a commit that referenced this pull request Mar 31, 2016
Enable support for standalone block statements.

```js
node 🙈 ₹ git:(upstream ⚡ bare-block) ./node
> { var x = 3; console.log(x); }
3
undefined
> {}
{}
> { x:1, y:"why not", z: function() {} }
{ x: 1, y: 'why not', z: [Function] }
>
```
For the ambiguous inputs like `{ x }`, the existing REPL
behaviour (ES6 literal shorthand) is preserved (prefers
expression over statement).

Fixes: #5576
PR-URL: #5581
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
evanlucas added a commit that referenced this pull request Mar 31, 2016
Notable changes:

* buffer:
  * make byteLength work with ArrayBuffer & DataView (Jackson Tian)
[#5255](#5255)
  * backport --zero-fill-buffers command line option (James M Snell)
[#5744](#5744)
  * backport new buffer constructor APIs (James M Snell)
[#5763](#5763)
  * add swap16() and swap32() methods (James M Snell)
[#5724](#5724)
* fs: add the fs.mkdtemp() function. (Florian MARGAINE)
[#5333](#5333)
* net: emit host in lookup event (HUANG Wei)
[#5598](#5598)
* node: --no-browser-globals configure flag (Fedor Indutny)
[#5853](#5853)
* npm: Upgrade to v3.8.3. (Forrest L Norvell)
* repl: support standalone blocks (Prince J Wesley)
[#5581](#5581)
* src: override v8 thread defaults using cli options (Tom Gallacher)
[#4344](#4344)
evanlucas added a commit that referenced this pull request Mar 31, 2016
Notable changes:

* buffer:
  * make byteLength work with ArrayBuffer & DataView (Jackson Tian)
[#5255](#5255)
  * backport --zero-fill-buffers command line option (James M Snell)
[#5744](#5744)
  * backport new buffer constructor APIs (James M Snell)
[#5763](#5763)
  * add swap16() and swap32() methods (James M Snell)
[#5724](#5724)
* fs: add the fs.mkdtemp() function. (Florian MARGAINE)
[#5333](#5333)
* net: emit host in lookup event (HUANG Wei)
[#5598](#5598)
* node: --no-browser-globals configure flag (Fedor Indutny)
[#5853](#5853)
* npm: Upgrade to v3.8.3. Fixes a security flaw in the use of
authentication tokens in HTTP requests that would allow an attacker to
set up a server that could collect tokens from users of the command-line
interface. Authentication tokens have previously been sent with every
request made by the CLI for logged-in users, regardless of the destination
of the request. This update fixes this by only including those tokens
for requests made against the registry or registries used for the
current install. (Forrest L Norvell)
[npm#6](npm#6)
* repl: support standalone blocks (Prince J Wesley)
[#5581](#5581)
* src: override v8 thread defaults using cli options (Tom Gallacher)
[#4344](#4344)
evanlucas added a commit that referenced this pull request Apr 1, 2016
Notable changes:

* buffer:
  * make byteLength work with ArrayBuffer & DataView (Jackson Tian)
[#5255](#5255)
  * backport --zero-fill-buffers command line option (James M Snell)
[#5744](#5744)
  * backport new buffer constructor APIs (James M Snell)
[#5763](#5763)
  * add swap16() and swap32() methods (James M Snell)
[#5724](#5724)
* fs: add the fs.mkdtemp() function. (Florian MARGAINE)
[#5333](#5333)
* net: emit host in lookup event (HUANG Wei)
[#5598](#5598)
* node: --no-browser-globals configure flag (Fedor Indutny)
[#5853](#5853)
* npm: Upgrade to v3.8.3. Fixes a security flaw in the use of
authentication tokens in HTTP requests that would allow an attacker to
set up a server that could collect tokens from users of the command-line
interface. Authentication tokens have previously been sent with every
request made by the CLI for logged-in users, regardless of the destination
of the request. This update fixes this by only including those tokens
for requests made against the registry or registries used for the
current install. (Forrest L Norvell)
[npm#6](npm#6)
* repl: support standalone blocks (Prince J Wesley)
[#5581](#5581)
* src: override v8 thread defaults using cli options (Tom Gallacher)
[#4344](#4344)
evanlucas added a commit that referenced this pull request Apr 1, 2016
Notable changes:

* buffer:
  * make byteLength work with ArrayBuffer & DataView (Jackson Tian)
[#5255](#5255)
  * backport --zero-fill-buffers command line option (James M Snell)
[#5744](#5744)
  * backport new buffer constructor APIs (James M Snell)
[#5763](#5763)
  * add swap16() and swap32() methods (James M Snell)
[#5724](#5724)
* fs: add the fs.mkdtemp() function. (Florian MARGAINE)
[#5333](#5333)
* net: emit host in lookup event (HUANG Wei)
[#5598](#5598)
* node: --no-browser-globals configure flag (Fedor Indutny)
[#5853](#5853)
* npm: Upgrade to v3.8.3. Fixes a security flaw in the use of
authentication tokens in HTTP requests that would allow an attacker to
set up a server that could collect tokens from users of the command-line
interface. Authentication tokens have previously been sent with every
request made by the CLI for logged-in users, regardless of the destination
of the request. This update fixes this by only including those tokens
for requests made against the registry or registries used for the
current install. (Forrest L Norvell)
[npm#6](npm#6)
* repl: support standalone blocks (Prince J Wesley)
[#5581](#5581)
* src: override v8 thread defaults using cli options (Tom Gallacher)
[#4344](#4344)

PR-URL: #5970
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.

Standalone blocks don't work in node REPL console
5 participants