Assigning to globals in strict mode
oliver at apple.com
Mon Oct 18 10:09:12 PDT 2010
Am I missing something important? Does delete fail for all properties on the global object in strict mode?
Or does the behaviour of put in strict mode result in new properties on the global object always being configurable = false?
On Oct 18, 2010, at 10:05 AM, Jeff Walden wrote:
> On 10/18/2010 09:59 AM, Oliver Hunt wrote:
>> On Oct 18, 2010, at 9:56 AM, Jeff Walden wrote:
>>> On 10/17/2010 02:56 PM, Oliver Hunt wrote:
>>>> "use strict"; this.declared = 5; declared = (delete declared, 5);
>>>> Will not throw, but instead will recreate the |declared| property.
>>> Shouldn't |delete declared| throw per 11.4.1 5a?
>> No because declared is deletable -- i didn't do 'var declared', it's an ordinary object property that just happens to be on the global object.
> I still read it differently. Evaluating |declared| in the delete expression should, per 11.1.2 and 10.3.1, result in a Reference. Per 10.2.2.1 step 4, that Reference should have a base which is an environment record and a strict mode flag of true. IsUnresolvableReference() is false because the base isn't undefined/false, IsPropertyReference() is false because the base value isn't an object or a Boolean/String/Number, so therefore you hit the step I mentioned. What am I missing?
More information about the es5-discuss