Skip to content

Simplify getConvertibleFieldAtPosition #23315

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
2 commits merged into from
Apr 16, 2018
Merged

Simplify getConvertibleFieldAtPosition #23315

2 commits merged into from
Apr 16, 2018

Conversation

ghost
Copy link

@ghost ghost commented Apr 10, 2018

Had some code review on #22143 but didn't want to delay it any longer. @Kingwl

  • PropertyDeclaration#parent is always a ClassLikeDeclaration. (In other contexts we use a PropertyAssignment or PropertySignature node instead. I know it's hard to keep track of all of these...)
  • There were some unnecessary checks: members is not an optional property (and besides, it must contain at least propertyDeclaration).
  • The get*Info functions share a lot in common, so it's simpler to check declaration.kind only when necessary.

@ghost ghost requested review from mhegazy and amcasey April 10, 2018 20:13
@ghost ghost force-pushed the rm_parent_members branch from 0e66efe to 65e879f Compare April 10, 2018 20:30
@ghost ghost changed the title Remove unnecessary check Simplify getConvertibleFieldAtPosition Apr 10, 2018
@ghost ghost merged commit cc6bc76 into master Apr 16, 2018
@ghost ghost deleted the rm_parent_members branch April 16, 2018 16:30
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
This pull request was closed.
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.

1 participant