Conditional catch clause
herby at mailbox.sk
Thu Dec 20 00:13:07 PST 2012
Brendan Eich wrote:
> Herby Vojčík wrote:
>> Is the idea of multiple channels (as I posted a few mails ago) not a
> I doubt it will gain champions. Once you have try/catch/finally, you've
> got enough to build such things via libraries. Adding channels under the
> hood doesn't help hide StopIteration, since control flow must stop and
> unwind when it is thrown. We can't blast past default-channel
> try/catch/finally's seeking one that handles StopIteration, we must at
> least run the finally clauses.
Yes, that was how I meant it. And every channel's finallies, not just
the default one.
> But those finally clauses if written for ES3 or above will assume that
> any abrupt completion was a default-channel exception, i.e, that the
> catch clause ran. Your proposal as I understand it breaks that
> compatibility constraint.
Good point, did not think of this.
More information about the es-discuss