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

Fix forEachChild jsdoc @typedef tag#18333

Merged
sandersn merged 4 commits into
mastermicrosoft/TypeScript:masterfrom
fix-forEachChild-JSDocTypedefTagmicrosoft/TypeScript:fix-forEachChild-JSDocTypedefTagCopy head branch name to clipboard
Sep 8, 2017
Merged

Fix forEachChild jsdoc @typedef tag#18333
sandersn merged 4 commits into
mastermicrosoft/TypeScript:masterfrom
fix-forEachChild-JSDocTypedefTagmicrosoft/TypeScript:fix-forEachChild-JSDocTypedefTagCopy head branch name to clipboard

Conversation

@sandersn

@sandersn sandersn commented Sep 7, 2017

Copy link
Copy Markdown
Member
  1. Remove JSDocTypeLiteral.jsdocTypeTag, which made no sense since it was only useful when storing information for its parent @typedef tag.
  2. Also only visit jsdocPropertyTags if they exist, to mirror the behaviour of visitNodes.

Fixes #18301

Also remove JSDocTypeLiteral.jsdocTypeTag, which made no sense since it
was only useful when storing information for its parent `@typedef` tag.
@sandersn sandersn requested review from a user and weswigham September 7, 2017 23:40
Comment thread src/compiler/parser.ts Outdated
}
typedefTag.typeExpression = finishNode(jsdocTypeLiteral);
const useChildTypeTagAsType = childTypeTag && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type);
typedefTag.typeExpression = useChildTypeTagAsType ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Probably better to make these one expression so that if we have strictNullChecks TS can infer that we just checked for childTypeTag being defined.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point. Done.

@sandersn sandersn merged commit d4e3e19 into master Sep 8, 2017
@sandersn sandersn deleted the fix-forEachChild-JSDocTypedefTag branch September 8, 2017 15:54
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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.

2 participants

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