Files
DefinitelyTyped/types
Retsam d73f413fb6 Fix inferred types for targetted error handlers
The typings for targetted catch statements don't infer properly with Error constructors, for example with `.catch(SomeErrorSubtype, (e) => /*...*/)`, `e` is inferred to be the constructor of SomeErrorSubtype, not an instance of SomeErrorSubtype, so this must be explicitly typed as `.catch(SomeErrorSubtype, (e: SomeErrorSubtype) => /*...*/)` for the typings to be accurate.  The root causes is that it is erroneously falling into the wrong overload, the overload that accepts arbitrary objects as the first argument to .catch.  This fix requires loosening the restriction that SomeErrorSubtype must be a subtype of Error, but otherwise preserves existing behavior.

Also, makes a utility type to reduce some of the boilerplate.
2017-12-13 14:02:42 -05:00
..
…
…
…
…
…
2017-12-05 18:27:52 +01:00
…
…
2017-12-09 09:59:31 -08:00
…
…
…
2017-12-06 08:49:04 -08:00
…
…
…
…
2017-12-10 15:46:18 -08:00
…
…
2017-12-06 17:28:33 +08:00
…
…
…
…
…
2017-12-11 13:01:28 +08:00
…
…
…
2017-12-04 11:01:50 +09:00
…
2017-12-10 20:30:07 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-12-05 13:26:22 +01:00
2017-12-06 14:18:09 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-12-04 12:26:48 +01:00
…
2017-12-02 11:26:31 -08:00
2017-12-02 11:26:31 -08:00
2017-12-02 11:26:31 -08:00
2017-12-03 22:41:26 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-12-12 19:25:40 +01:00
2017-12-10 23:34:48 -08:00
…
…
…
…
…
2017-12-08 13:36:53 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
2017-12-08 21:57:17 +09:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-12-11 23:54:17 +00:00
…
2017-12-05 08:53:30 -07:00
…
…
…
…
…
…
…
…
…
…
…
2017-12-05 08:32:40 +01:00
2017-12-06 21:24:05 +00:00
…
…
…
…
2017-12-02 21:38:58 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-12-03 11:53:58 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-12-08 17:12:09 +01:00
…
2017-12-05 00:22:50 +08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-12-07 14:17:24 +01:00
2017-12-04 17:32:04 +13:00
…
…
…
…
…
2017-12-06 00:00:23 +08:00
2017-12-09 12:38:47 +01:00
…
…
…
…
…
…
…
…
2017-12-05 12:13:28 +01:00
…
2017-12-12 11:26:34 +00:00
2017-12-06 18:10:07 -03:00
…
2017-12-04 19:00:18 +00:00
…
…
…
2017-12-11 09:36:31 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-12-05 12:56:21 -05:00
…
…
…
…
…
…
…
2017-12-05 11:00:46 +02:00
…
…
…
…
…
…
…
…
…
…
…
2017-12-03 13:42:25 +03:00
2017-12-05 09:51:10 +01:00
…
…
…
…
…
…
…
2017-12-06 10:16:28 +02:00
…
…
…