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.  However, it is hard to 
actually observe outside of a REPL.  Try this variant

function f() {
   {;} + {}
}

to more clearly see what is being parsed.

{ } + {}

clearly belongs in anybodies wtfjs list

Allen

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to