Skip to content
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

Primitive type guards are order independent #9036

Merged
merged 4 commits into from
Jun 13, 2016

Conversation

sandersn
Copy link
Member

@sandersn sandersn commented Jun 8, 2016

Fixes #9020

Previously, only type guards of the form `typeof x === 'string'` were
allowed. Now you can write `'string' === typeof x`.
@ahejlsberg
Copy link
Member

Shouldn't this also include checks of the form null === x?

@sandersn
Copy link
Member Author

sandersn commented Jun 9, 2016

Good idea. Done.

@mhegazy
Copy link
Contributor

mhegazy commented Jun 13, 2016

👍

@sandersn sandersn merged commit 8b09312 into master Jun 13, 2016
@sandersn sandersn deleted the primitive-type-guards-are-order-independent branch June 13, 2016 17:52
@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.

4 participants