tc39 / proposal-cancelable-promises

Former home of the now-withdrawn cancelable promises proposal for JavaScript
Other
375 stars 29 forks source link

Should `else`/`except` clauses only be allowed in async functions? #62

Closed bergus closed 7 years ago

bergus commented 7 years ago

I think we want cancellations only in asynchronous code, not in synchronous code. Would it therefore make sense to keep else/except clauses that specifically handle non-cancellation-exceptions only inside async function bodies, just like the await.cancelToken meta property (#39)?

domenic commented 7 years ago

No, it's paramount that the sync/async symmetry be kept; this is a strong design constraint that we will not be changing.