Skip to content

Null and undefined are allowed as index expressions #10009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 16, 2016

Conversation

sandersn
Copy link
Member

null and undefined are not allowed with --strictNullChecks turned on. Previously, they were disallowed whether or not it was on.

eg window[null] is allowed with strictNullChecks: false, even though it's a bad idea, because Window has a numeric index signature.

Fixes #9684.

sandersn added 2 commits July 28, 2016 09:15
`null` and `undefined` are not allowed with `--strictNullChecks` turned
on. Previously, they were disallowed whether or not it was on.
@sandersn
Copy link
Member Author

sandersn commented Aug 8, 2016

@vladima @yuit @ahejlsberg could you take a look at this fix? It's a simple 3-line change.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 16, 2016

👍

@sandersn sandersn merged commit 01aaff7 into master Aug 16, 2016
@sandersn sandersn deleted the null-undefined-allowed-as-index-expressions branch August 16, 2016 22:47
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants