const initializers: once more unto the breach
brendan at mozilla.org
Wed Mar 21 09:47:53 PDT 2012
There are still temporal dead zone cases that can't be statically
analyzed -- at least not without an aggressive higher-order control flow
analysis, and even then analysis is approximate so we'd have to mandate
false positives or bail to dynamic checks.
Isn't the issue that strict mode would dynamically check these in some
implementations, and statically check them in others?
Andreas Rossberg wrote:
> On 20 March 2012 21:46, Allen Wirfs-Brock <allen at wirfs-brock.com
> <mailto:allen at wirfs-brock.com>> wrote:
> It is an open issue whether an implementation should be
> permitted/required/forbidden to report the statically detectable
> cases as early errors.
> The obvious and (and IMO right) rule is that static checks should be
> required iff the declaration is in strict code -- which generally
> implies that the use site and any scope in-between is strict code,
> too. So it can be statically checked in all those cases. In sloppy
> mode, you're on your own as usual.
> The only potential problem I can foresee with that is the current
> strict mode loop hole with indirect 'eval' in combination with const
> declarations in the global scope, depending on how exactly we will
> decide on global scope semantics. (That is, we should try to find a
> semantics that maintains the above invariant.)
> es-discuss mailing list
> es-discuss at mozilla.org
More information about the es-discuss