return when desugaring to closures

Mark S. Miller erights at
Sun Oct 12 19:10:28 PDT 2008

On Sun, Oct 12, 2008 at 5:45 PM, David-Sarah Hopwood
<david.hopwood at> wrote:
> Since LabelledStatement is included in SubStatement, the following is
> allowed in the current ES3.1 draft:
>  while (...) foo: var x = ...;

This will be corrected in the next version. But the agreed fix is not
to make LabelledStatement a Statement. The fix is to make a
LabelledStatement contain only a SubStatement. So the above will still
be rejected, but

    while (...) foo: {var x = ...;}

will be fine.


More information about the Es-discuss mailing list