Syntax error for lexical declarations not directly within block

Claude Pache claude.pache at gmail.com
Mon Apr 15 06:41:38 PDT 2013


Le 15 avr. 2013 à 15:29, André Bargull <andre.bargull at udo.edu> a écrit :

> Statements and Declarations are separate production rules (cf. "12 Statements and Declarations" in the draft), only a Statement can be nested directly within an if-Statement.
> 
> - André
> 

Indeed, thanks.

—Claude

> 
>> Hi,
>> 
>> I've noted that it is a Syntax error to write things like `if (foo) let x;` or `while (bar) let x;` (without block enclosing the `let x` statement), both in the latest version of FF and Chrome (appropriate experimental flags enabled), which is a very reasonable behaviour. However, I was unable to find where (or if) that behaviour is defined in the current spec draft. Could you help?
>> 
>> Thanks,
>> 
>> —Claude



More information about the es-discuss mailing list