return when desugaring to closures

Mark S. Miller erights at google.com
Sun Oct 12 15:34:10 PDT 2008


On Sun, Oct 12, 2008 at 2:19 PM, Yuh-Ruey Chen <maian330 at gmail.com> wrote:
> David-Sarah Hopwood wrote:
>>   { while (...) let x = ...; }
> I was under the impression that such statements should be disallowed,
> following the example of JS1.8. In JS1.8 (Fx3), the following are all
> syntax errors:
>
> while (...) let x = ...;
> do let x = ...; while (...);
> if (...) let x = ...;
> for (...) let x = ...;

These are unconditionally disallowed starting in ES3.1 because such
declarations are Statements but not SubStatements and only
SubStatements are allowed by the grammar at the positions above.


-- 
    Cheers,
    --MarkM


More information about the Es-discuss mailing list