let function

Garrett Smith dhtmlkitchen at gmail.com
Thu May 14 20:16:02 UTC 2015

On 5/14/15, Alexander Jones <alex at weej.com> wrote:
> Ah, thanks for explaining! What about the Temporal Dead Zone of let,
> or const binding semantics, for those of us who are obsessive enough to
> desire that kind of thing everywhere?
Let a constructive discussion about this proposal take place.

"The specification," can most reasonably be taken among programmers to
mean "the latest version of  specification" not "draft specification"
or "proposal". Evangelists and standards geeks tend to miscall "draft"
"specification" to the misfortunate effect that it misleads developers
into believing that drafts are normative, final, etc. That's quite a
bit worse than the abrasiveness and confusion seen here, but hopefully
they can stop and a discussion can take place.


Because of these irreconcilable differences, the use of a
FunctionDeclaration as a Statement results in code that is not
reliably portable among implementations. It is recommended that
ECMAScript implementations either disallow this usage of
FunctionDeclaration or issue a warning when such a usage is

The decision for such wording probably came from discussions and time
constraints of getting ES5 done. The problem of FunctionDeclaration
arose from implementations in JScript (see "[MS-ES3EX]" and language
extensions in Spidermonkey and others. It progressed to misstatements
in presentations and books. For more on this, see "Named function
expressions demystified".

> On Thursday, May 14, 2015, Bergi <a.d.bergi at web.de> wrote:
>> Alexander Jones schrieb:
>> > On Thursday, May 14, 2015, Domenic Denicola <d at domenic.me> wrote:
>> >
>> >>   They can, in fact, be scoped in a for loop.
>> >
>>> That's not what I see, in strict mode at least, which I assume most
>>> people
>>> consider de facto by now!
>>> From V8:
>>>      SyntaxError: In strict mode code, functions can only be declared at
>>> top
>>> level or immediately within another function.
>> That's ES5. In ES6, function declarations are allowed in blocks - with
>> the
>> new block scope semantics. This was only possible as ES5 strict mode held
>> that spot open so now it doesn't break anything :-)
>> Yes, it will need a while until people get accustomed to that.
>>  Bergi
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list