On Tue Jan 06 2015 at 2:18:47 AM Isiah Meadows <[email protected]> wrote:
> > From: Alex Kocharin <[email protected]> > > To: Gary Guo <[email protected]>, "[email protected]" < > [email protected]> > > Cc: "[email protected]" <[email protected]> > > Date: Tue, 06 Jan 2015 06:59:52 +0300 > > Subject: Re: (x) => {foo: bar} > > > > 06.01.2015, 06:38, "Gary Guo" <[email protected]>: > > > > > > Though I am strongly negative, but there actually is such an > implementation. The REPL of node will parse {a:1} as object literal while > {a:1;} as block. > > > > > > Node.js REPL wraps all the statements in parentheses. Therefore `{a:1;}` > becomes `({a:1;})` which is a syntax error. > > > > Not in my REPL (node 0.10.33). > > ``` > $ node > > {a:1;} > 1 > > {a:1} > { a: 1 } > ``` > > What the Node.js REPL effectively appears to do, AFAICT, is some sort > of evented try-catch. No, that's not what it does. Alex was close, but not exactly right. The REPL will test input and wrap if necessary: https://github.com/joyent/node/blob/master/lib/repl.js#L266-L271 Rick
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

