Skip to content

Commit 348fc7e

Browse files
author
Kanchalai Tanglertsampan
committed
Take into account optional property in parameter
1 parent ebbfca9 commit 348fc7e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/compiler/binder.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference path="utilities.ts"/>
1+
/// <reference path="utilities.ts"/>
22
/// <reference path="parser.ts"/>
33

44
/* @internal */
@@ -2178,7 +2178,11 @@ namespace ts {
21782178
case SyntaxKind.JSDocRecordMember:
21792179
return bindPropertyWorker(node as JSDocRecordMember);
21802180
case SyntaxKind.JSDocPropertyTag:
2181-
return declareSymbolAndAddToSymbolTable(node as JSDocPropertyTag, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
2181+
let optionalType = 0;
2182+
if ((node as JSDocPropertyTag).typeExpression.type.kind === SyntaxKind.JSDocOptionalType) {
2183+
optionalType = SymbolFlags.Optional;
2184+
}
2185+
return declareSymbolAndAddToSymbolTable(node as JSDocPropertyTag, SymbolFlags.Property | optionalType, SymbolFlags.PropertyExcludes);
21822186
case SyntaxKind.JSDocFunctionType:
21832187
return bindFunctionOrConstructorType(<SignatureDeclaration>node);
21842188
case SyntaxKind.JSDocTypeLiteral:

0 commit comments

Comments
 (0)