Oliver Hunt (2013-11-06T23:23:38.000Z)
domenic at domenicdenicola.com (2013-11-17T17:48:19.499Z)
On Nov 6, 2013, at 3:14 PM, Rick Waldron <waldron.rick at gmail.com> wrote: > This may be a naïve question, but how would the handler know which object/weakref had been gc'ed? You wouldn’t :) I’m kind of anti-finalisers in JS for all of the reasons people have raised - they are extremely hazardous, expose non-deterministic behaviour, etc Given our general desire to avoid exposing internal GC semantics, and the difficulty in defining observable GC behaviour (I suspect this would be a non-starter in any case), I can’t see any specification that would allow useful finalisers or WeakRefs. If MarkM has an idea for WeakRefs that don’t leak observable GC behaviour i’d love to hear, but in general i’m opposed to both them and finalisers :-/