On Oct 1, 2014, at 10:30 AM, Mark Miller wrote: > > > On Wed, Oct 1, 2014 at 9:15 AM, Allen Wirfs-Brock <[email protected]> > wrote: > > On Oct 1, 2014, at 9:05 AM, Mark S. Miller wrote: > >> Good point. If we can require all such assignments to be rejected >> statically, why is a runtime assignment to a const variable even possible? >> Can't we just assert that this cannot occur? > > The runtime cases I meant are the ones you mentioned. Sloppy with or eval > dynamically shadowing a sloppy a [[Set]] reference to a const binding. Can't > be a early error, should be a runtime error. > > Although it is a bit late to suggest it ;) ... > > Couldn't we have "with" and sloppy direct eval ignore/skip const and let > bindings? Then these errors could always be early.
Actually we've already agreed that eval puts const/let/class bindings into a separate lexical scope. But, an eval can still var shadow an outer const declaration. Allen
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

