`free` operator

David Herman dherman at mozilla.com
Thu Oct 25 23:03:10 PDT 2012


A feature you shouldn't use in production is a feature your attackers will use in production. ;)

Dave

On Oct 25, 2012, at 10:28 PM, Patrick Mueller <pmuellr at gmail.com> wrote:

> On Thu, Oct 25, 2012 at 8:20 PM, John J Barton <johnjbarton at johnjbarton.com> wrote:
> On Thu, Oct 25, 2012 at 4:16 PM, Isaac Schlueter <i at izs.me> wrote:
> > It'd be really nice if JS had a way to explicitly delete an object.
> 
> I guess you mean ... a way to set all the refs to a object to undefined.
> 
> Isaac's `free` sounds like Smalltalk's one-way `become: nil`: 
> 
>     http://live.exept.de/doc/online/english/programming/classicBugs.html#BUG8
>     http://gbracha.blogspot.com/2009/07/miracle-of-become.html
> 
> Probably not the best idea to be using this in production code.  For debugging though, AWESOME.  And once we have classes, `allInstances()` will be nice as well. :-)
> 
> Wondering if, for node.js anyway, you could use the V8 HeapSnapshot to find your references:
> 
>     http://v8.googlecode.com/svn/trunk/include/v8-profiler.h
> 
> Didn't proxies have some way of doing a become: and freezing themselves as a new object?  Maybe that was the older Proxy stuff, didn't see it in the current drafts.  But did see "Revokable Proxies", which sounds like it might fit the bill, though you'd have to arrange to proxy the sketchy object early:
> 
>     http://wiki.ecmascript.org/doku.php?id=strawman:revokable_proxies
> 
> -- 
> Patrick Mueller
> http://muellerware.org
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



More information about the es-discuss mailing list