Iterators, generators, finally, and scarce resources
Boris Zbarsky
bzbarsky at MIT.EDU
Wed Apr 30 09:59:26 PDT 2014
On 4/30/14, 3:09 AM, Andy Wingo wrote:
> There are no other objects in JS that have a finalization facility or
> other "shut down" semantics.
This has actually come up as a problem for DOM objects. Some people
actually want a semi-generic facility to say "I'm done with you" instead
of having to have per-object-type hacks...
> And yet many of them can indeed hold onto
> scarce resources (to the extent that is possible in JS, which is to say,
> approximately never in the browser)
It happens all the time in the browser. You can hold on to address
space (e.g. via huge typed arrays). You can hold on to graphics card
resources via WebGL objects. I expect to see more instances of this as
we expose more hardware capabilities to the web.
> and none of them have similar facilities.
This is certainly true, sadly.
-Boris
More information about the es-discuss
mailing list