File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1866,7 +1866,7 @@ namespace ts {
1866
1866
case SyntaxKind . Identifier :
1867
1867
case SyntaxKind . StringLiteral :
1868
1868
case SyntaxKind . NumericLiteral :
1869
- return isDeclaration ( name . parent ) && name . parent . name === name ;
1869
+ return isDeclaration ( node . parent ) && node . parent . name === name ;
1870
1870
default :
1871
1871
return false ;
1872
1872
}
@@ -4300,7 +4300,9 @@ namespace ts {
4300
4300
4301
4301
/** @internal */
4302
4302
export function isNamedDeclaration ( node : Node ) : node is NamedDeclaration & { name : DeclarationName } {
4303
- return ! ! ( node as NamedDeclaration ) . name ;
4303
+ const name = ( node as NamedDeclaration ) . name ;
4304
+ Debug . assert ( ! name || isDeclaration ( node ) && node . name === name , "A 'name' property should always be a DeclarationName." ) ;
4305
+ return ! ! name ;
4304
4306
}
4305
4307
4306
4308
export function getNameOfDeclaration ( declaration : Declaration | Expression ) : DeclarationName | undefined {
You can’t perform that action at this time.
0 commit comments