Take into account optional property in parameter

This commit is contained in:
Kanchalai Tanglertsampan 2017-05-24 16:37:02 -07:00
parent ebbfca9847
commit 348fc7e51e

View File

@ -1,4 +1,4 @@
/// <reference path="utilities.ts"/>
/// <reference path="utilities.ts"/>
/// <reference path="parser.ts"/>
/* @internal */
@ -2178,7 +2178,11 @@ namespace ts {
case SyntaxKind.JSDocRecordMember:
return bindPropertyWorker(node as JSDocRecordMember);
case SyntaxKind.JSDocPropertyTag:
return declareSymbolAndAddToSymbolTable(node as JSDocPropertyTag, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
let optionalType = 0;
if ((node as JSDocPropertyTag).typeExpression.type.kind === SyntaxKind.JSDocOptionalType) {
optionalType = SymbolFlags.Optional;
}
return declareSymbolAndAddToSymbolTable(node as JSDocPropertyTag, SymbolFlags.Property | optionalType, SymbolFlags.PropertyExcludes);
case SyntaxKind.JSDocFunctionType:
return bindFunctionOrConstructorType(<SignatureDeclaration>node);
case SyntaxKind.JSDocTypeLiteral: