Set Error.prototype.cause type to unknown (#70)#49639
Set Error.prototype.cause type to unknown (#70)#49639RyanCavanaugh merged 1 commit intomicrosoft:mainfrom
Conversation
Signed-off-by: Abdul-Azeez Lawal <[email protected]>
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
|
|
voxpelli
left a comment
There was a problem hiding this comment.
This is a good change. Would fix voxpelli/pony-cause#35
|
@iamharbie @mkubilayk @dragomirtitian What's needed to get the CLA signed? My guess is that Bloomberg already has a signed CLA, just that @iamharbie hasn't been added to it and thus that the bot doesn't pick it up? |
|
Oh, apparently the Bloomberg CLA thing is being worked on by @RyanCavanaugh: #49675 (comment) |
…error` on TS `4.8` by @voxpelli This commit fixes the following error, which appears when running TS `^4.8.0-dev.20220707` with eg. ` npx tsc --lib es2020,es2022.error,es2021.promise` or ` npx tsc --lib esnext` > error TS2425: Class 'Error' defines instance member property 'cause', but extended class 'VError' defines it as instance member function. Discovered in voxpelli/pony-cause#41 when looking to extend the tests for voxpelli/pony-cause#35 to detect whether the nightly of `4.8.0` now correctly fixes that, following the merge of microsoft/TypeScript#49639
Describe your changes
This PR fixes #45167 which changes the type of
Error.prototype.causefromErrortoUnknownTesting performed
I added new tests to ensure that unknown type is recognised
Additional context
Could also potentially resolve #48098. @DanielRosenwasser's suggested being more restrictive with the type of the
causeproperty of the options param. I am open to discussions on this.Fixes #45167
Credits to Bloomberg colleagues who helped with reviews @mkubilayk @dragomirtitian