New ES6 draft now available

Allen Wirfs-Brock allen at wirfs-brock.com
Sun Nov 25 13:37:34 PST 2012


On Nov 25, 2012, at 12:41 PM, Tom Van Cutsem wrote:

> Hi Allen,
> 
> Great to see a first draft of the Proxy spec. I'll study this revision more closely over the coming week.
> 
> Some initial comments below:
> 
> 2012/11/23 Allen Wirfs-Brock <allen at wirfs-brock.com>
> 
> 	• MOP changes: Added [[GetInheritance]]/[[SetInheritance]] as internal methods for accessing [[Prototype]] internal prototype chain.
> 
> I would rename these to [[GetProto]]/[[SetProto]] (or [[GetPrototype]] as David suggests).
>  
>  Added [[[IsExtensible]]/[[PreventExtensions]].
>  
> Replaced [[Get]]/[[Put]] with [[GetP]]/[[SetP]]. At some point we may be able to rename these as [[Get]]/[[Set]].
> 
> +1 for [[Get]]/[[Set]]. The P suffix was indeed to distinguish this operation from ES5.1 [[Get]].
>  
>  Eliminated [[GetProperty]], [[CanPut]], [[HasProperty]], [[DefaultValue]]. 
> 
> Great!
> 
> However, with [[HasProperty]] removed, I assume the "in"-operator no longer triggers the "has" trap when it encounters a proxy, instead doing the proto-chain-walk itself and calling "hasOwn" on each level. This is OK, although it introduces an inconsistency with the other proto-chain-walking algorithms, which stop when encountering a proxy, letting the proxy take over from that point (this is the case for the "get", "set" and "enumerate" traps).

[[HasProperty]] is replaced with a HasProperty abstract operation (9.3.6) that indeed makes generic calls to [[HasOwnProperty]] and [[GetInheritance]]  in a loop.  This also slightly bothers me. I guess I convinced my self that an object that wanted to use a non-standard inheritance path could hide that by reporting its inherited properties to be own properties.

I also occasionally find it troubling  inheritance semantics are replicated in three different places [[GetP]], [[SetP]], and HasProperty and that it is quite possible to get them out of sync.   I've come to accept the replication/possible inconsistency but maybe we really do need to bring back [[HasProperty]] so that it is possible to consistently over-ride all three.  I'd might be happy to swap [[Feeze]]/[[Seal]]/i[[sFrozen]]/[[isSealed]] for [[HasProperty]]  :-)

Allen




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121125/2b265f71/attachment-0001.html>


More information about the es-discuss mailing list