Help wanted: Membrane proxies + Object.freeze() == paradox
Mark S. Miller
erights at google.com
Tue May 23 15:50:37 UTC 2017
Take a look at Tom's explanation of the "shadow target" technique at
https://research.google.com/pubs/pub40736.html
section 4.3
On Tue, May 23, 2017 at 8:45 AM, Jason Orendorff <jason.orendorff at gmail.com>
wrote:
> On Tue, May 23, 2017 at 2:44 AM, Alex Vincent <ajvincent at gmail.com> wrote:
>
>> Full details are at https://github.com/ajvincent/es7-membrane/issues/79
>> , which is where I'm hoping to find a solution.
>>
>
> To fix this, you must create a third object for each dry proxy, to serve
> as its [[ProxyTarget]]. There's no way around it. And you're right, it's
> not easy; you have to implement all of the handler methods, because none of
> the defaults do the right thing anymore.
>
> All the target checks in the design were intended to (a) allow proxies to
> claim to have immutable parts; and yet (b) maintain the language's
> invariants that immutable parts cannot change, even for proxies.
> [[ProxyTarget]] looks like an ease-of-use feature, but it's not; it's
> really in support of (a) and (b), and as you've found, it actually makes
> some things harder.
>
> -j
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
--
Cheers,
--MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170523/a40056cd/attachment.html>
More information about the es-discuss
mailing list