Proxy objects and collection

Daurnimator quae at
Tue Sep 2 11:57:58 PDT 2014

On 2 September 2014 14:41, Brendan Eich <brendan at> wrote:

> Daurnimator wrote:
>> So, I'd like to see some sort of "trap" that is fired when a Proxy is
>> collected.
>> To prevent over specifying how Javascript garbage collectors should
>> operate,
>> I propose that the trap *may* only be called at some *undefined* point
>> after the object is not strongly referenced.
> What would you need in the way of an argument to be passed to the trap, at
> this later point?

I'd imagine the proxy itself (which would be `this`).
The trap would not need to return anything.

There might be an argument here for some sort of object id instead of the
proxy itself, to avoid resurrection?
I'm not sure if Javascript implementations already deal with this elsewhere.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list