Skip to content

Commit cabe4d3

Browse files
author
Yui T
committed
Address PR
1 parent 348fc7e commit cabe4d3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/compiler/binder.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,11 +2178,10 @@ namespace ts {
21782178
case SyntaxKind.JSDocRecordMember:
21792179
return bindPropertyWorker(node as JSDocRecordMember);
21802180
case SyntaxKind.JSDocPropertyTag:
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);
2181+
return declareSymbolAndAddToSymbolTable(node as JSDocPropertyTag,
2182+
(node as JSDocPropertyTag).typeExpression && (node as JSDocPropertyTag).typeExpression.type.kind === SyntaxKind.JSDocOptionalType ?
2183+
SymbolFlags.Property | SymbolFlags.Optional : SymbolFlags.Property,
2184+
SymbolFlags.PropertyExcludes);
21862185
case SyntaxKind.JSDocFunctionType:
21872186
return bindFunctionOrConstructorType(<SignatureDeclaration>node);
21882187
case SyntaxKind.JSDocTypeLiteral:

0 commit comments

Comments
 (0)