@@ -3492,7 +3492,6 @@ module ts {
3492
3492
}
3493
3493
}
3494
3494
3495
- let result : DefinitionInfo [ ] = [ ] ;
3496
3495
3497
3496
// Because name in short-hand property assignment has two different meanings: property name and property value,
3498
3497
// using go-to-definition at such position should go to the variable declaration of the property value rather than
@@ -3501,16 +3500,19 @@ module ts {
3501
3500
// assignment. This case and others are handled by the following code.
3502
3501
if ( node . parent . kind === SyntaxKind . ShorthandPropertyAssignment ) {
3503
3502
let shorthandSymbol = typeInfoResolver . getShorthandAssignmentValueSymbol ( symbol . valueDeclaration ) ;
3503
+ if ( ! shorthandSymbol ) {
3504
+ return [ ] ;
3505
+ }
3506
+
3504
3507
let shorthandDeclarations = shorthandSymbol . getDeclarations ( ) ;
3505
3508
let shorthandSymbolKind = getSymbolKind ( shorthandSymbol , typeInfoResolver , node ) ;
3506
3509
let shorthandSymbolName = typeInfoResolver . symbolToString ( shorthandSymbol ) ;
3507
3510
let shorthandContainerName = typeInfoResolver . symbolToString ( symbol . parent , node ) ;
3508
- forEach ( shorthandDeclarations , declaration => {
3509
- result . push ( getDefinitionInfo ( declaration , shorthandSymbolKind , shorthandSymbolName , shorthandContainerName ) ) ;
3510
- } ) ;
3511
- return result
3511
+ return map ( shorthandDeclarations ,
3512
+ declaration => getDefinitionInfo ( declaration , shorthandSymbolKind , shorthandSymbolName , shorthandContainerName ) ) ;
3512
3513
}
3513
3514
3515
+ let result : DefinitionInfo [ ] = [ ] ;
3514
3516
let declarations = symbol . getDeclarations ( ) ;
3515
3517
let symbolName = typeInfoResolver . symbolToString ( symbol ) ; // Do not get scoped name, just the name of the symbol
3516
3518
let symbolKind = getSymbolKind ( symbol , typeInfoResolver , node ) ;
0 commit comments