Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix soundness issue with Object.values and Object.entries.
Back in November 2016, a PR (microsoft#12207) was submitted to make the types of `Object.entries` and `Object.values` generic. This PR was reviewed and accepted, and as a note it was recommended that `Object.keys` be updated similarly. The author then submitted a PR to update `Object.keys` (microsoft#12253) but @ahejlsberg made the [very valid point](microsoft#12253 (comment)) that this change was unsound and the PR was closed. The author of both PRs then suggested that perhaps microsoft#12207 should be reverted, but this change never happened. This PR tries to rectify this situation and make `Object.entries` and `Object.values` consistent with the sound behavior of `Object.keys`. The major issue here is that this *IS* a breaking change since people may be relying on the currently unsound behavior of `Object.values` and `Object.entries`. However, I think having TypeScript be inconsistent on this front indefinitely is not good, so at the least this PR should be merged into TS 4.x.
- Loading branch information