Implementing membranes using proxies, and [[GetInheritance]]

Tom Van Cutsem at
Wed Sep 11 07:22:11 PDT 2013

2013/9/11 David Bruant <bruant.d at>

> I think it was discussed at some point to get rid of the restriction on
> the getPrototypeOf trap and enforce it only for non-extensible objects (but
> I can't find the info anymore, I might just be inventing this...). It would
> allow you to return a different object assuming the target is and remains
> extensible (more on that below).

No, I think you're confusing with an invariant on [[SetInheritance]].
Basically [[SetInheritance]] has no invariants as long as the object is
extensible. If it is non-extensible, then proxies enforce that the
prototype of proxy and target are the same, see <>.

[[GetInheritance]] always checks whether the proxy and target's prototype
are the same, but as you pointed out, if the target is extensible, you can
set its prototype to some other object before returning a value from the
getPrototypeOf trap.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list