Re: WindowProxy objects violate ES5 invariants

On Thu, Dec 13, 2012 at 10:54 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 12/13/12 1:43 PM, Mark S. Miller wrote:
>>>
>>> Note also that there may be some cases in which a WindowProxy will simply
>>> stop pointing to any Window completely.  I don't know whether any of
>>> these
>>> are (yet?) exposed to the web platform...
>>
>>
>> I'm surprised by this and it sounds important. Could you expand?
>
>
> One example present in Firefox right now is described at
> <http://blog.kylehuey.com/post/21892343371/fixing-the-memory-leak>.  The
> summary is that all cross-global references in Gecko are handled via
> proxies, and in some instances we will go ahead and change the proxy handler
> on those proxies to one that throws on every single property access (more
> precisely on every single handler hook call) so that we can get rid of the
> object that was being proxied.  Obviously such a proxy would have to always
> claim all its properties are configurable to satisfy the invariants we're
> describing here or something.

No, that change of behavior is fine. The invariants don't say when the
operations must succeed. They only constrain what happens when they
succeed. For example, that's why direct proxies allow revokable
forwarding to frozen objects.


>
> -Boris



--
    Cheers,
    --MarkM

Received on Thursday, 13 December 2012 18:58:13 UTC