alex at weej.com
Thu May 14 20:37:05 UTC 2015
Good points. All the more reason to throw out declarations as statements in
favour of let/const/var, which we all have to understand well anyway, for
other types of variable.
On Thursday, May 14, 2015, Garrett Smith <dhtmlkitchen at gmail.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".
> >> Alexander Jones schrieb:
> >> > On Thursday, May 14, 2015, Domenic Denicola <d at domenic.me
> >> >
> >> >> 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
> >>> 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
> >> 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
> >> https://mail.mozilla.org/listinfo/es-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss