Proxies and preventExtensions: how to avoid inconsistency in a membrane?

Alex Vincent ajvincent at
Sun Sep 4 20:44:03 UTC 2016

On Sun, Sep 4, 2016 at 1:14 PM, Tom Van Cutsem < at> wrote:

> Essentially, if you want to implement a membrane that works in the face of
> ES invariants, you need to use the "shadow target" technique where the
> membrane proxy is not directly targeting the "real" target object but
> instead a "dummy" target object that it can use to be more flexible in what
> it can answer. It seems that is more or less the solution you stumbled
> upon. See <
> examples/generic_membrane.js> for a membrane implementation that works
> this way.

Ah, nuts.  I suspected that might be the case.  Well, it's ugly but it *is*
doable within the rules, and I already have an appropriate code point to
make that work out.  (Nice that the first argument of each trap is the
proxy target.)

Regarding .hasBeenRevoked, yes, I get that too.  The revoke function from
Proxy.revocable() handles only the proxy itself, no administration of
metadata around that.  Oh, well, it was worth a shot.

"The first step in confirming there is a bug in someone else's work is
confirming there are no bugs in your own."
-- Alexander J. Vincent, June 30, 2001
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list