A DOM use case that can't be emulated with direct proxies

Brandon Benvie brandon at brandonbenvie.com
Wed Dec 12 13:16:09 PST 2012


This use case is much more strongly aligned with the purely virtual object
than it is for the forwarded one, despite the goal being to wrap real
objects. Doing fancy things with object identity requires it.


On Wed, Dec 12, 2012 at 3:42 PM, Kevin Reid <kpreid at google.com> wrote:

> On Wed, Dec 12, 2012 at 12:35 PM, David Bruant <bruant.d at gmail.com> wrote:
>
>> I was a bit too strong in my statement, sorry. Let me rephrase: the
>> internal [[Target]] can't be changed, but a proxy can emulate changing of
>> "fake" target as long as what happens with this "fake" target doesn't
>> involve invariant checking.
>> That's the reason I was suggesting that WindowProxies could (maybe
>> depending on how the object reference was obtained) throw whenever
>> invariant checks are involved.
>>
>
> Exactly. So a user-defined switching proxy needs only to:
> 1. refuse to commit to any invariant (non-configurable property or
> preventExtensions)
> 2. even if its switchable-target has an invariant, do not expose that
> invariant (i.e. pretend each property is configurable)
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121212/4123a5fc/attachment-0001.html>


More information about the es-discuss mailing list