Commit 42717320 authored by Prince J Wesley's avatar Prince J Wesley Committed by Evan Lucas
Browse files

repl: support standalone blocks

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: https://github.com/nodejs/node/issues/5576
PR-URL: https://github.com/nodejs/node/pull/5581


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarEvan Lucas <evanlucas@me.com>
parent 0d0c57ff
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment