yield* desugaring

Brendan Eich brendan at mozilla.com
Mon May 13 12:03:22 PDT 2013


Andy Wingo wrote:
> But that's precisely what we can't guarantee: unlike function
> activations, the dynamic extent of a generator activation is unlimited.
> We don't have finalizers, so we can't ensure that a finally block runs.

Otherwise browsers would be even more trivially DoS-attacked.

We went over this in 2006 and agreed then that finally cannot be 
guaranteed. This is true even without generators:

function foo() {
   try {
     while (true);
   } finally {
     alert('so sorry');
   }
}
foo()

Browsers must police infinte loops and offer to kill such runaways. The 
finally can't run.

/be


More information about the es-discuss mailing list