Skip to content

Remove redundant checks in getNameOfDeclaration#25244

Merged
1 commit merged into
masterfrom
getNameOfDeclaration
Jun 27, 2018
Merged

Remove redundant checks in getNameOfDeclaration#25244
1 commit merged into
masterfrom
getNameOfDeclaration

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jun 26, 2018

  • if (!declaration) is redundant since the input type is declared non-optional.
  • case SyntaxKind.JSDocCallbackTag: has the same behavior as just falling through to the bottom.

@ghost ghost force-pushed the getNameOfDeclaration branch 2 times, most recently from 4411e5f to da37958 Compare June 26, 2018 20:45
@ghost ghost force-pushed the getNameOfDeclaration branch from da37958 to 677f320 Compare June 27, 2018 00:20
@ghost ghost requested a review from sandersn June 27, 2018 01:02
Comment thread src/compiler/checker.ts
let type = getLateBoundSymbol(prop).nameType;
if (!type && !isKnownSymbol(prop)) {
const name = getNameOfDeclaration(prop.valueDeclaration);
const name = prop.valueDeclaration && getNameOfDeclaration(prop.valueDeclaration);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did these work before? Is valueDeclaration's type incorrect?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Later: Yes, it is.)

@ghost ghost merged commit fd8b7f3 into master Jun 27, 2018
@ghost ghost deleted the getNameOfDeclaration branch June 27, 2018 20:56
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
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