Allow `try…catch` blocks to return a value.

Bucaran jbucaran at me.com
Sat Jul 11 21:53:52 UTC 2015


Allow `try…catch` blocks to return a value.

Sometimes I wrap a `try…catch` in a function and return a value based in whether there was an error or not.

It would be useful if you could use `return` inside a `try…catch` block to accomplish the same.


```js
 let stuff = try {
   return ...
 } catch (e) { return … ? … : ... }
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150712/c5fe3cf1/attachment.html>


More information about the es-discuss mailing list