microsoft / microsoft/TypeScript
Object.getOwnPropertyDescriptors accepts undefined (lib.es2017.object.d.ts)
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 3.4.5
Search Terms:
getOwnPropertyDescriptors
Code
Object.getOwnPropertyDescriptors(undefined);
Expected behavior:
Undefined is not accepted.
Actual behavior:
Undefined is accepted.
Playground Link:
https://www.typescriptlang.org/play/index.html#src=Object.getOwnPropertyDescriptors(undefined)%3B
However, can't seem to enable es2017 in the Playground
Related Issues:
n/a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib.es2017.object.d.ts and the declaration for Object.getOwnPropertyDescriptors. Reproduce the issue with Object.getOwnPropertyDescriptors(undefined), then verify that the type checker rejects undefined while valid inputs remain accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100