[whatwg] [[GetOwnProperty]] for named properties of the Window object

Gavin Barraclough barraclough at apple.com
Thu Sep 5 15:45:55 PDT 2013


Hi,

I was wondering if anyone could help clarify expected behavior of [[GetOwnProperty]] for named properties of the Window object.  (It looks like this falls across the HTML5 & WebIDL specs, apologies if this is the wrong place to ask).

Per WebIDL’s definition of [Global] (http://dev.w3.org/2006/webapi/WebIDL/#Global) the named properties are exposed on a named properties object on the prototype chain.
Per section 4.5.5.1 (http://dev.w3.org/2006/webapi/WebIDL/#named-properties-object) the [[GetOwnProperty]] implementation should return a descriptor with writable set to false, enumerable and configurable set to true.

Firefox and Chrome both return descriptors from an object on the prototype chain per the spec, attributes of the value are configured differently, with enumerable set to false, writable and configurable set to true.

There seem to be some compelling reasons to follow Firefox / Chrome (writable true seems more congruent with ECMA262 specified [[Put]], unless there is another mechanism I’m missing here, enumerable is odd since I don’t think the spec says anything about [[GetOwnPropertyNames]]),so I was hoping to better understand why the spec requires the behaviour it does (or whether I’m just following it incorrectly!)

Many thanks,
Gavin


More information about the whatwg mailing list