April 10 2014 Meeting Notes

Allen Wirfs-Brock allen at wirfs-brock.com
Fri Apr 25 09:51:03 PDT 2014


On Apr 25, 2014, at 9:44 AM, Rick Waldron wrote:

> 
> 
> 
> On Fri, Apr 25, 2014 at 12:10 PM, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
> 
> The solution "Outlawing 'yield' in a try-finally", is that _only_ for try-finally? What about: 
> 
>   function * g() {
>     try {
>       yield iWillCauseAReferenceError();
>     } catch(e) {
>       console.log("an error happened:", e);
>     }
>   }
> 
>   var gen = g();
>   gen.next();
> 

That's fine and has an internally consistent semantics.

Finally is the problem and only try-finally and try-catch-finally need to have a yield restriction on the try block.

Allen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140425/e75d44d6/attachment.html>


More information about the es-discuss mailing list