Membranes, unmediated access to objects through Object.getPrototypeOf

Tom Van Cutsem at
Tue Oct 9 12:01:08 PDT 2012

2012/10/9 Mark S. Miller <erights at>

> On Tue, Oct 9, 2012 at 6:25 AM, David Bruant <bruant.d at> wrote:
>> In a way, what I'm asking is to make dummy target "official" and more
>> restricted, by not allowing arbitrary objects, but only proxies with the
>> actual target in their target chain.
> Making them more official and restricted sounds promising. But if I
> understand the rest of your sentence, what you're suggesting is not more
> restricted, it's differently restricted. And the way it is less restricted
> is, IMO, bad.

To make matters more concrete, one way in which the chaperone-approach
would differ visibly from the current state has to do with caching. As Mark
said, the invariants related to getPrototypeOf and frozen properties have
more to do with stability than with identity.

Valid approach today:

var desc = Object.getOwnPropertyDescriptor(obj, "foo");
// assume "foo" is a data property
if (!desc.configurable && !desc.writable) {
  var cached =;
  /* from now on, can reliably use cached instead of */

If we would relax the frozen property get invariant, if obj is a proxy, could evaluate to a different proxy (admittedly to the same target)
even though "foo" is non-configurable, non-writable. This can lead to
observably different behavior.

(getPrototypeOf is analogous)

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

More information about the es-discuss mailing list