{Spam?} Re: Proposal: Syntax sugar for single exit and early exit functions.

Brendan Eich brendan at mozilla.org
Wed Nov 19 16:37:17 PST 2014

Christian Mayer wrote:
> Am 18.11.2014 um 22:03 schrieb Brendan Eich:
>> >  Christian Mayer wrote:
>>> >>  What I actually sometimes really miss in JavaScript (having a big C++
>>> >>  background) are destructors.
>>> >>
>>> >>  (I haven't checked if they are in any new version proposal, though)
>> >  
>> >  No, as JS has no stack storage class, only we-hope-unobservable GC, no
>> >  destructors.
> I fully understand that something called at GC time won't work - but
> that's not a real destructor for me, that would be a sort of
> "destroyer"...:)


> The destructor should IMHO be called when the JS internal ref count gets
> to 0, i.e. when the object gets released to the GC to do it's job when
> it wants to.

JS does not mandate reference counting, and I know of no competitive 
engine that uses it.


More information about the es-discuss mailing list