[Harmony Proxies] Proposal: Property fixing

Allen Wirfs-Brock allen at wirfs-brock.com
Wed Jun 15 08:51:32 PDT 2011


On Jun 15, 2011, at 8:10 AM, Brendan Eich wrote:

> On Jun 15, 2011, at 5:19 AM, David Bruant wrote:
> 
> 
>> Of course this solution is valid as long as observable side effects of [[Class]] can be redefined.
>> This is not the case for the .length issue.
> 
> 
> Can you give an example of the length issue? Sorry if I missed it.
> 

From a posting I made earlier in this thread:

> Doesn't this new proposal still preclude using proxies to create an exact emulation of the built-in Array object type.  The "length" property of arrays is specified to be non-configurable yet special behavior must occur each time the value of length is changed.  The proposal would allow "length" to be "fixed"  as an accessor property whose set behavior did the necessary processing.  However, that is also a violation of the Array specification as it requires that "length" exhibit the attributes of a data property. 
> 
> I emphasize Array when I look at this simply because it is a fairly simple example of the sort of thing that a host object might currently do and the most important use case of proxies for me is the replacement/emulation of host objects.  I really don't know where this idea that non-configurable implies no special semantics comes from.  That isn't the case in the ES5 specification  (10.6,15.3.5.4,15.4.5.1+15.4.5.2, 15.5.5.2) for such properties.  

More generally, for better or worse, Cameron McCormack is right now busily working to publish the last call draft of a Web IDL specification that includes rules for what the attribute settings must be for all DOM properties.  If those rules don't match up with what proxies can express then there will be issues with implementing the DOM in ECMAScript.

Allen



More information about the es-discuss mailing list