On Sun, Oct 12, 2008 at 7:55 PM, David-Sarah Hopwood <[EMAIL PROTECTED]> wrote: > In ES3.1, this will mean that they normally require braces whenever a > body can introduce variables. There are two classes of exceptions, > shown by these examples: > > a) while (...) foo: var x = ...; > b) while (...) for (var x = ...; ...; ...) {} > > I think these are bugs. a) can certainly be disallowed. There might > possibly be existing code that is relying on b), confusing though it > is, but it can be disallowed in strict mode at least.
ES3.1 will disallow #a because a LabelledStatement can only contain a SubStatement. A variable declaration is a Statement but not a SubStatement. Your point about #b is interesting. I do not know if it has previously been raised. -- Cheers, --MarkM _______________________________________________ Es-discuss mailing list Es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss