Re: Firefox/Chrome: {} + {} etc.

2012-01-27 Thread Axel Rauschmayer
Ah! Good call. And, as expected, wrapping the first operand in parens makes the problem go away. REPL input is tricky to parse correctly in JS, kind of between statements and expressions. On Jan 27, 2012, at 16:56 , Bradley Meck wrote: Chrome and FF are treating the leading {} as an empty

RE: Firefox/Chrome: {} + {} etc.

2012-01-27 Thread Luke Hoban
Rauschmayer Sent: Friday, January 27, 2012 8:21 AM To: es-discuss Subject: Re: Firefox/Chrome: {} + {} etc. Ah! Good call. And, as expected, wrapping the first operand in parens makes the problem go away. REPL input is tricky to parse correctly in JS, kind of between statements and expressions. On Jan

Re: Firefox/Chrome: {} + {} etc.

2012-01-27 Thread Allen Wirfs-Brock
On Jan 27, 2012, at 8:38 AM, Luke Hoban wrote: JS REPLs tend to parse input as Program productions. Parsing {} + {} as a block followed by a unary expression is correct according to ES5 grammar for Program. IE behaves the same. It's not just in Program, it's any statement context.

Re: Firefox/Chrome: {} + {} etc.

2012-01-27 Thread Axel Rauschmayer
JS REPLs tend to parse input as Program productions. Parsing {} + {} as a block followed by a unary expression is correct according to ES5 grammar for Program. IE behaves the same. It's not just in Program, it's any statement context. However, it is hard to actually observe