4 ms·
Optional catch binding[0], which is at stage 3, seems like a bad idea[1] and has been pointed out as such[2] [0] http://2ality.com/2017/08/optional-catch-bindi
by nikcub 9y ago
Optional catch binding[0], which is at stage 3, seems like a bad idea[1] and has been pointed out as such[2]
[0] http://2ality.com/2017/08/optional-catch-binding.html http://2ality.com/2017/08/optional-catch-binding.html
[1] http://wiki.c2.com/?EmptyCatchClause http://wiki.c2.com/?EmptyCatchClause
[2] https://github.com/tc39/proposal-optional-catch-binding/issues/2 https://github.com/tc39/proposal-optional-catch-binding/issu...
- bterlson 9y agoIf anyone has any data on this topic I would love to hear and understand it!
- acdha 9y agoThe github issue seems to cover this well: existing linters have code to cover intentionally unused bindings and this is a cleaner way to express that. Do you disagree with the rationale in that discussion?
- pitaj 9y agoThat's true, but in that case adding optional catch binding is completely useless.
- nikcub 9y agoI'd be more ok with it being paired with exception filtering (or what Netscape called conditional catch clauses), ie. } catch (e if e instanceof CriticalError) { // handle critical } catch (e if e instanceof TypeError) { // handle type mismatch } catch () { } so you could at least handle critical and other errors before blindly silencing - but for some reason exception filtering/conditional catch hasn't come up in ECMA