-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptExperimentation NeededSomeone needs to try this out to see what happensSomeone needs to try this out to see what happensGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
Description
lib Update Request
Configuration Check
My compilation target is es5
and my lib is ["dom", "dom.iterable", "esnext"]
.
(Which I believe does not matter in this context as the definition of freeze
is inside lib.es5.d.ts
solely.)
Missing / Incorrect Definition
Object.freeze
It is defined in a way that in IDEs it is always supposed the input is an array.
Sample Code
Object.freeze<{someKey: 'someValue'}>({/* the problem is with autocomplete here (in IDEs) */});
Documentation Link
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
I believe the overload that forces arrays is defined in this PR:
https://github.com/microsoft/TypeScript/pull/12434/files
And I believe just removing it will suffice (and the user of Object.freeze needs to specify its an array in case its an array)
If it is confirmed, I would be happy to create the PR for it.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptExperimentation NeededSomeone needs to try this out to see what happensSomeone needs to try this out to see what happensGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this