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

[Master] Take into account optional property in parameter#16070

Merged
yuit merged 4 commits into
mastermicrosoft/TypeScript:masterfrom
master-15916microsoft/TypeScript:master-15916Copy head branch name to clipboard
May 26, 2017
Merged

[Master] Take into account optional property in parameter#16070
yuit merged 4 commits into
mastermicrosoft/TypeScript:masterfrom
master-15916microsoft/TypeScript:master-15916Copy head branch name to clipboard

Conversation

@yuit

@yuit yuit commented May 24, 2017

Copy link
Copy Markdown
Contributor

Fix #15916

  • Add tests

Comment thread src/compiler/binder.ts Outdated
case SyntaxKind.JSDocPropertyTag:
return declareSymbolAndAddToSymbolTable(node as JSDocPropertyTag, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
let optionalType = 0;
if ((node as JSDocPropertyTag).typeExpression.type.kind === SyntaxKind.JSDocOptionalType) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typeExpression could be undefined.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

consider inlinng this as:

function bindJSDocPropertyTag(node: JSDocPropertyTag) {
    return declareSymbolAndAddToSymbolTable(node, node.typeExpression && node.typeExpression.type.kind === SyntaxKind.JSDocOptionalType? SymbolFlags.Property | SymbolFalgs.Optionl : SymbolFlags.Property, SymbolFlags.PropertyExcludes);
}

@yuit yuit merged commit 068256b into master May 26, 2017
@yuit yuit deleted the master-15916 branch May 26, 2017 05:05
@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.

3 participants

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