Mark S. Miller wrote: > On Tue, Oct 21, 2008 at 3:42 PM, Waldemar Horwat <[EMAIL PROTECTED]> wrote: >> What does ES3.1 do if you have both const x and var x at the top level? > > It just so happens that we discussed top level const in this morning's > ES3.1 phone meeting. It never occurred to us to ban top level const. > We did discuss making top level const scoped just to the program unit > vs adding a property to the global object. We also discussed the const > read barrier issue. Of your taxonomy of four choices, we had been > writing the spec on the assumption of dynamic dead zone, but we think > we would prefer static dead zone if its spec is simple enough and if > it's simple enough to understand in practice. Given the number of > choices and the complexity of choosing among them, especially our > ignorance of the implications of "static dead zone", we decided to > pull "const" from ES3.1.
I understand the implications of "static dead zone"; I just worked through them for Jacaranda 0.4. It is definitely possible to guarantee static initialization safety for 'let' and 'const' declarations, checkable using a simple and efficient algorithm (linear in the size of the block), and without any read or write barriers. The resulting function hoisting behaviour is a fairly simple generalization of ES3. I'll post a fleshed-out proposal either tomorrow or Thursday. > If we got in wrong in ES3.1, we couldn't fix it later. That's true, but I still hope to convince you and the group that we can get it right for ES3.1. -- David-Sarah Hopwood _______________________________________________ Es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

