On Mar 22, 2012, at 9:10 AM, Brendan Eich wrote:
> Allen Wirfs-Brock wrote:
>> On Mar 21, 2012, at 10:11 AM, Brendan Eich wrote:
>>
>>> > Andreas Rossberg wrote:
>>>> >> Right, but my comment was only about checking of assignments to const
>>>> >> variables. Those are always an error, regardless of TDZ behaviour.
>>> > > Agreed, absolutely. In all-strict code we know all the bindings, we
>>> > see all assignments.
>>
>> Yes, but just because a function is strict doesn't mean that everything is
>> strict:
>>
>> {const c=0;
>> with (someObj) {
>> (function() {"use strict"}; c=2})();
>> }
>> }
>
> Yup, hence my "all-strict" short-hand for Andreas's more carefully worded
> "iff the declaration is in strict code -- which generally implies that the
> use site and any scope in-between is strict code ...."
I agree, assignment to such declarations should always be early errors. It may
still end of being most practical to specify this in propose
Allen
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss