Assigning to globals in strict mode

Oliver Hunt oliver at apple.com
Tue Oct 19 16:22:31 PDT 2010


On Oct 19, 2010, at 4:19 PM, Maciej Stachowiak wrote:

> 
> On Oct 19, 2010, at 4:15 PM, Oliver Hunt wrote:
> 
>> 
>> On Oct 19, 2010, at 4:00 PM, Brendan Eich wrote:
>> 
>>> On Oct 19, 2010, at 3:37 PM, Brendan Eich wrote:
>>> 
>>>> On Oct 19, 2010, at 1:13 PM, Oliver Hunt wrote:
>>>> 
>>>>> On Oct 19, 2010, at 1:09 PM, Brendan Eich wrote:
>>>>> 
>>>>> Anyhoo, I jsut tested a firefox nightly (i was hoping that ffx threw after evaluating the lhs so we could just say that the behaviour of two impls matched) and it fires after evaluating the rhs.  Would you like me to file a bug?
>>>> 
>>>> Not yet -- jorendorff is making the case for PutValue (after RHS evaluation).
>>>> 
>>>> Really need Allen to weigh in here, he may be able to in between SPLASH (OOPSLA forever in my heart) sessions.
>>> 
>>> Really, the spec says what it says: PutValue. (And [[DefineOwnProperty]] as jorendorff noted.)
>> 
>> Ah I see, the note in 11.13.1 is simply summarising what will happen in strict mode -- it is not intended to specify behaviour merely describe it, that was where my misunderstanding came from.
> 
> If Harmony is going to require the other behavior, how about an erratum to make ES5 strict mode the same? There doesn't seem to be much reason to have a future behavior difference here.

In harmony you have a purely lexical scope, eg. the global object is not at the head of the scope chain.  That means all unqualified names can be resolved statically so all these errors become early errors.

In ES5 there is both with() and the global object that make early errors incompatible.

> 
> Regards,
> Maciej

--Oliver

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es5-discuss/attachments/20101019/853bf6c3/attachment.html>


More information about the es5-discuss mailing list