Skip to content

Commit b702062

Browse files
Addressed code review feedback.
1 parent 281d821 commit b702062

File tree

1 file changed

+4
-11
lines changed
  • src/compiler/transformers

1 file changed

+4
-11
lines changed

src/compiler/transformers/ts.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2662,26 +2662,19 @@ namespace ts {
26622662
}
26632663

26642664
/**
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.
26682667
*/
26692668
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.
26722669
if (currentScopeFirstDeclarationsOfName) {
26732670
const name = declaredNameInScope(node);
26742671
return currentScopeFirstDeclarationsOfName.get(name) === node;
26752672
}
2676-
2677-
// Otherwise, we can't be sure. For example, this node could be synthetic.
26782673
return true;
26792674
}
26802675

26812676
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);
26852678
return (node.name as Identifier).escapedText;
26862679
}
26872680

@@ -2760,7 +2753,7 @@ namespace ts {
27602753
return createNotEmittedStatement(node);
27612754
}
27622755

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.");
27642757
enableSubstitutionForNamespaceExports();
27652758

27662759
const statements: Statement[] = [];

0 commit comments

Comments
 (0)