Implementing membranes using proxies, and [[GetInheritance]]

Allen Wirfs-Brock allen at wirfs-brock.com
Wed Sep 11 09:17:09 PDT 2013


On Sep 11, 2013, at 8:53 AM, David Bruant wrote:

> Le 11/09/2013 17:51, Allen Wirfs-Brock a écrit :
>>> 
>>> Ps: btw, wasn't "GetInheritance" supposed to be renamed "GetPrototype"?
>>> 
>>> I think we had agreement on that. Allen?
>> 
>> I'm willing to call them [[GetPrototypeOf]] and [[SetPrototypeOf]] to match the trap names. I prefer avoiding a direct connotation with the [[Prototype]] internal data property as an exotic object is not required to have one.
> Is there a precedent of such an object?

For example, Proxy instances...
Also, Imay be mistaken but I think that prior to IE9, its COM based host objects did not have a [[Prototype]].

More generally, ES objectness is defined behaviorally via the MOP, not by any required representation of internal states. We don't impose any representational requirements upon exotic objects, just that they expose, in an implementation appropriate manner, the MOP interface. 

> Why can't such objects have a [[Prototype]] to null (as is the practice in userland JS)?

They don't need to because nothing in the ES6 spec. except for the the ordinary definition of [[GetInheritance]]/[[SetInheritance]] accesses [[Prototype]] directly.  All access go through those MOP calls.  So, it is totally up to the implementation of those MOP operations to decide on any backing store.

Allen



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


More information about the es-discuss mailing list