@@ -439,7 +439,7 @@ namespace ts {
439
439
// during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation
440
440
// and this case is specially handled. Module augmentations should only be merged with original module definition
441
441
// and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed.
442
- const isJSDocTypedefInJSDocNamespace = node . kind === SyntaxKind . JSDocTypedefTag &&
442
+ const isJSDocTypedefInJSDocNamespace = isInJavaScriptFile ( node ) && node . kind === SyntaxKind . JSDocTypedefTag &&
443
443
( node as JSDocTypedefTag ) . name &&
444
444
( node as JSDocTypedefTag ) . name . kind === SyntaxKind . Identifier &&
445
445
( ( node as JSDocTypedefTag ) . name as Identifier ) . isInJSDocNamespace ;
@@ -1913,9 +1913,7 @@ namespace ts {
1913
1913
// Here the current node is "foo", which is a container, but the scope of "MyType" should
1914
1914
// not be inside "foo". Therefore we always bind @typedef before bind the parent node,
1915
1915
// and skip binding this tag later when binding all the other jsdoc tags.
1916
- if ( isInJavaScriptFile ( node ) ) {
1917
- bindJSDocTypedefTagIfAny ( node ) ;
1918
- }
1916
+ bindJSDocTypedefTagIfAny ( node ) ;
1919
1917
1920
1918
// First we bind declaration nodes to a symbol if possible. We'll both create a symbol
1921
1919
// and then potentially add the symbol to an appropriate symbol table. Possible
@@ -2003,7 +2001,7 @@ namespace ts {
2003
2001
// for typedef type names with namespaces, bind the new jsdoc type symbol here
2004
2002
// because it requires all containing namespaces to be in effect, namely the
2005
2003
// current "blockScopeContainer" needs to be set to its immediate namespace parent.
2006
- if ( ( < Identifier > node ) . isInJSDocNamespace ) {
2004
+ if ( isInJavaScriptFile ( node ) && ( < Identifier > node ) . isInJSDocNamespace ) {
2007
2005
let parentNode = node . parent ;
2008
2006
while ( parentNode && parentNode . kind !== SyntaxKind . JSDocTypedefTag ) {
2009
2007
parentNode = parentNode . parent ;
@@ -2149,7 +2147,7 @@ namespace ts {
2149
2147
case SyntaxKind . InterfaceDeclaration :
2150
2148
return bindBlockScopedDeclaration ( < Declaration > node , SymbolFlags . Interface , SymbolFlags . InterfaceExcludes ) ;
2151
2149
case SyntaxKind . JSDocTypedefTag :
2152
- if ( ! ( < JSDocTypedefTag > node ) . fullName || ( < JSDocTypedefTag > node ) . fullName . kind === SyntaxKind . Identifier ) {
2150
+ if ( isInJavaScriptFile ( node ) && ( ! ( < JSDocTypedefTag > node ) . fullName || ( < JSDocTypedefTag > node ) . fullName . kind === SyntaxKind . Identifier ) ) {
2153
2151
return bindBlockScopedDeclaration ( < Declaration > node , SymbolFlags . TypeAlias , SymbolFlags . TypeAliasExcludes ) ;
2154
2152
}
2155
2153
break ;
0 commit comments