A (perhaps) useful thing to keep in mind.

Brendan Eich brendan at mozilla.com
Wed Nov 23 11:32:28 PST 2011

On Nov 22, 2011, at 8:21 AM, Jorge wrote:

> It seems that all of these are equally valid ways to say "function ƒ () { ... }" :
> function ƒ () { ... }
> function ƒ () {{ ... }}
> function ƒ () {{{ ... }}}
> .. etc.
> I think that perhaps it can be used cleverly to hack something useful. For example, a generator instead an asterisk, might require two braces. Or whatever. Just saying.

No, we want a breaking syntactic change for generators, even empty ones (no 'yield' -- also, yield could be written to look like a function call). We do not want existing code that for whatever reason (accidentally, even) doubled function body braces to suffer a shift of meaning. That's a runtime-incompatible change. We're keeping five fingers of fate for those:

1. Lexical scope at top level (no window property aliasing from global vars).
2. typeof null == "null".
3-5. reserved, I hope not to use any more.


More information about the es-discuss mailing list