@@ -2662,26 +2662,19 @@ namespace ts {
2662
2662
}
2663
2663
2664
2664
/**
2665
- * Determines whether a declaration is *could* be the first declaration with
2666
- * the same name emitted in the current scope. Only returns false if we are absolutely
2667
- * certain a previous declaration has been emitted.
2665
+ * Determines whether a declaration is the first declaration with
2666
+ * the same name emitted in the current scope.
2668
2667
*/
2669
2668
function isFirstEmittedDeclarationInScope ( node : ModuleDeclaration | EnumDeclaration ) {
2670
- // If the node has a named symbol, then we have enough knowledge to determine
2671
- // whether a prior declaration has been emitted.
2672
2669
if ( currentScopeFirstDeclarationsOfName ) {
2673
2670
const name = declaredNameInScope ( node ) ;
2674
2671
return currentScopeFirstDeclarationsOfName . get ( name ) === node ;
2675
2672
}
2676
-
2677
- // Otherwise, we can't be sure. For example, this node could be synthetic.
2678
2673
return true ;
2679
2674
}
2680
2675
2681
2676
function declaredNameInScope ( node : FunctionDeclaration | ClassDeclaration | ModuleDeclaration | EnumDeclaration ) : __String {
2682
- if ( node . name . kind !== SyntaxKind . Identifier ) {
2683
- Debug . fail ( formatSyntaxKind ( node . kind ) + " should have an identifier name." ) ;
2684
- }
2677
+ Debug . assertNode ( node . name , isIdentifier ) ;
2685
2678
return ( node . name as Identifier ) . escapedText ;
2686
2679
}
2687
2680
@@ -2760,7 +2753,7 @@ namespace ts {
2760
2753
return createNotEmittedStatement ( node ) ;
2761
2754
}
2762
2755
2763
- Debug . assert ( isIdentifier ( node . name ) , "A TypeScript namespace should have an Identifier name." ) ;
2756
+ Debug . assertNode ( node . name , isIdentifier , "A TypeScript namespace should have an Identifier name." ) ;
2764
2757
enableSubstitutionForNamespaceExports ( ) ;
2765
2758
2766
2759
const statements : Statement [ ] = [ ] ;
0 commit comments