Proposal: Bind Promise Catch to Try/Catch scope

Todd Hubers todd.hubers at
Wed Jun 22 00:55:24 UTC 2016


Problem: Try blocks don’t work in a callback world.

Proposed solution:

   - Implement API: window.callback.getCatch() - which is a callback to the
   parent catch block scope.
      - Ie. While the try scope is entered, internally the catch handler is
      stored as a function (window.callback.activeCatch.push(thisCatch)). When
      the try scope is left, that value is popped.
   - Promise: defaults its catch callback to whatever getCatch() returns

I'm sure there are plenty more details that could be covered and "Callback
API" and "getCatch" are totally open to debate. But I hope you get the gist
of it efficiently with this email.


Todd Hubers (BBIT Hons)
Software Engineer

Contact <> | Availability

Sent with MailTrack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list