On 28 October 2014 23:22, Jeff Walden <[email protected]> wrote: > On 10/28/2014 09:10 AM, Andreas Rossberg wrote: >> If so, how do we fix this? Allowing shadowing after the fact is pretty >> bad, since it will probably make all accesses to builtin globals >> slower in ES6. But it is particularly bad for 'undefined', where the >> ability to rebind would break various assumptions and optimisations >> based on its immutability. > > This seems avoidable to me, even with the current spec language. > Implementations would simply need to track syntactically-global accesses > (accesses that are global only at runtime, due to dynamic scoping via with, > eval, and similar are already slow, so effects on their perf seem ignorable). > Then, if a new script's compilation would introduce a shadowing lexical > declaration, invalidate the existing global-access code, such that when it > next runs it takes account of the shadowing declaration. (Or appears to have > that effect.) What am I missing?
It's possible, but introducing code dependencies would be rather heavy-weight machinery for supporting a "feature" that nobody wants. If lexical declaration semantics required deopts then I would consider that a serious design fail. /Andreas _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

