I still can't see why it's superior to standardizing SpiderMonkey
non-standard syntax.
```
try { ...
} catch(e if e instanceof Error) {
}
```
I think it's rather inferior, because your doesn't allow C#-like exception
filters. It saves you 14 characters, but limits your "easy" filters to
`instanceof`.
To quote article on C# exception filters:
> For example, let’s say you are writing code to perform some operation
against a dependency, and that dependency will throw an exception with a
*bool* property that tells you whether the operation *IsRetryable*.
> Now, let’s say that as we’re calling this dependency, we want to be able
to retry any error that has *IsRetryable == true* up to three times, then
abandon if it throws a fourth time.
I think it's legitimate use case and why can't we kill two birds with one
stone? Moreover, I think it's bad idea to add static typing to language in
only one place (catch clauses).
On Fri, May 27, 2016 at 11:05 AM, Arthur Stolyar <[email protected]>
wrote:
> Something wrong with prev link.
> https://github.com/zenparsing/es-typed-catch
> On May 27, 2016 12:00, "Arthur Stolyar" <[email protected]> wrote:
>
>> If something, here seems to be another similar proposal:
>> https://github.com/zenparsing/es-typed-catch
>>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss