On Sat, Aug 12, 2017 at 7:14 AM, Hikaru Nakashima <[email protected]>
wrote:
> In addition, there is `optional catch binding` proposal, and this
> idea is less dangerous.
> Rather, this idea looks natural, because `foo = try bar` is looks
> like `foo = do { try { bar } }` .
I think you're misunderstanding the [optional catch binding proposal][1].
It does **not** make `try { something }` valid. It makes `try { something }
catch { }` valid. It's for all those times you don't need the exception, so
the *binding* (the `(e)` part of `catch (e)`) is made optional.
If I'm wrong about your misunderstanding the proposal, my apologies; if so,
what's dangerous about optional catch bindings?
Making `catch` optional would indeed, in my view, be dangerous, which is
why I don't like the suggestion that's the topic of this thread. If you're
going to ignore exceptions on a block, for which, yes, there are valid use
cases, I much prefer that it be explicit.
-- T.J. Crowder
[1]: https://tc39.github.io/proposal-optional-catch-binding/
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss