Proposal: Abstract References

Tom Van Cutsem at
Mon Oct 27 08:50:14 PDT 2014

2014-10-27 15:00 GMT+01:00 Andreas Rossberg <rossberg at>:
> > but without breaking membrane transparency.
> I'm still not sure I understand how this affects membranes
> specifically. A membrane would never pass a proxied object to a
> non-proxied function from the same side. So functions accessing (or
> testing for) private state on an object are a non-issue in that
> scenario, because this access never crosses the membrane, does it?
> After all, membranes work just fine with builtins or host objects
> (otherwise they would be useless).

I believe what Mark was referring to is the fact that if a WeakMap crosses
the membrane, it gets proxied. Manipulating the WeakMap using
WeakMap.prototype.{get,set} subsequently allows the membrane to intercept
and wrap those operations.

With (private) symbols, we couldn't come up with a satisfactory way to
combine them with membranes. Treating the symbol as data and passing it
straight through the membrane creates an obvious leak. Treating it as an
opaque identity and proxying that identity results in a useless proxied
identity on the other side of the membrane. W.r.t. membranes, the key point
of using WeakMaps for private state is that the membrane can properly
intercept the 'get' and 'set' operations.

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

More information about the es-discuss mailing list