mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Fix #2725: Add check for parent before using it
This commit is contained in:
parent
6637f49209
commit
4e42054277
@ -3109,6 +3109,7 @@ module ts {
|
||||
|
||||
case SyntaxKind.SemicolonToken:
|
||||
return containingNodeKind === SyntaxKind.PropertySignature &&
|
||||
previousToken.parent && previousToken.parent.parent &&
|
||||
(previousToken.parent.parent.kind === SyntaxKind.InterfaceDeclaration || // interface a { f; |
|
||||
previousToken.parent.parent.kind === SyntaxKind.TypeLiteral); // let x : { a; |
|
||||
|
||||
@ -3124,7 +3125,8 @@ module ts {
|
||||
case SyntaxKind.DotDotDotToken:
|
||||
return containingNodeKind === SyntaxKind.Parameter ||
|
||||
containingNodeKind === SyntaxKind.Constructor ||
|
||||
(previousToken.parent.parent.kind === SyntaxKind.ArrayBindingPattern); // var [ ...z|
|
||||
(previousToken.parent && previousToken.parent.parent &&
|
||||
previousToken.parent.parent.kind === SyntaxKind.ArrayBindingPattern); // var [ ...z|
|
||||
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
|
||||
6
tests/cases/fourslash/completionAfterDotDotDot.ts
Normal file
6
tests/cases/fourslash/completionAfterDotDotDot.ts
Normal file
@ -0,0 +1,6 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////.../**/
|
||||
|
||||
goTo.marker();
|
||||
verify.not.completionListIsEmpty();
|
||||
Loading…
x
Reference in New Issue
Block a user