`free` operator

Yehuda Katz wycats at gmail.com
Thu Oct 25 21:38:25 PDT 2012

Any proposal that destroys this invariant:

function() {
var x = obj();

// other statements not involving x

x // still defined

destroys local reasoning and would almost certainly do more harm than good.

In programs with leaks, the leak is often inside of library code, and
breaking the library's own invariants will cause more confusion, not less,
in many cases.

I shudder to think about bug reports I would receive in my libraries where
someone forced a variable reference I was holding to become undefined or
start throwing if I try to reference it.

-- Yehuda Katz
(ph) 718.877.1325
On Oct 25, 2012 9:25 PM, "John J Barton" <johnjbarton at johnjbarton.com>

> On Oct 25, 2012 8:42 PM, "Domenic Denicola" <domenic at domenicdenicola.com>
> wrote:
> >
> > The new thing this proposal brings to the table is the ability to mark,
> from within your code, exactly what object you're worried about the
> leakiness of. You also get very understandable error messages for
> determining who's using that object. Pouring through the list of retained
> objects, trying to find the one you're concerned about by looking through
> ambiguous short names or via the profiler's deep tree hierarchy, is not
> nearly as straightforward.
> But don't you get that by just changing one line to
>     var obj = undefined;
> ?
> jjb
> _______________________________________________
> 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/20121025/f21321e3/attachment.html>

More information about the es-discuss mailing list