Skip to content

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

Merged
yuit merged 4 commits into
masterfrom
master-15916
May 26, 2017
Merged

[Master] Take into account optional property in parameter#16070
yuit merged 4 commits into
masterfrom
master-15916

Conversation

@yuit
Copy link
Copy Markdown
Contributor

@yuit yuit commented May 24, 2017

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