Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Simplify getConvertibleFieldAtPosition#23315

Merged
2 commits merged into
mastermicrosoft/TypeScript:masterfrom
rm_parent_membersmicrosoft/TypeScript:rm_parent_membersCopy head branch name to clipboard
Apr 16, 2018
Merged

Simplify getConvertibleFieldAtPosition#23315
2 commits merged into
mastermicrosoft/TypeScript:masterfrom
rm_parent_membersmicrosoft/TypeScript:rm_parent_membersCopy head branch name to clipboard

Conversation

@ghost

@ghost ghost commented Apr 10, 2018

Copy link
Copy Markdown

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 amcasey and mhegazy 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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.