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

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


On Sun, Sep 4, 2016 at 1:14 PM, Tom Van Cutsem <tomvc.be at gmail.com> 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 <https://github.com/tvcutsem/harmony-reflect/blob/master/
> 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: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160904/9ac809ed/attachment.html>


More information about the es-discuss mailing list