Jeremy Martin (2013-11-20T16:05:54.000Z)
domenic at domenicdenicola.com (2013-11-29T17:31:28.582Z)
I can't speak for Benjamin, but I would like to "+1" the notion that try/catches could benefit from some form of error pattern matching. Here's an example that attempts to avoid conflation with async control-flow considerations: ```javascript try { JSON.parse(getJSONString()); } catch (err) { if (err instanceof SyntaxError) { // handle the error } else { throw err; } } ``` Discriminatory error handling like this is not all that uncommon, and could potentially benefit from an expansion of the existing http://wiki.ecmascript.org/doku.php?id=strawman:guards. For example: ```javascript try { JSON.parse(getJSONString()); } catch (err :: SyntaxError) { // handle the error } ``` This of course has larger implications, though, as you'd presumably need to support multiple "guarded" catches, and behavior for a failed guard is different in the try/catch scenario than with parameters or properties.