Skip to content

Commit 9277c03

Browse files
Check whether class declarations have a name, falling back to "default".
1 parent 54352dc commit 9277c03

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/transformers/declarations.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,8 @@ namespace ts {
11001100
if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== SyntaxKind.NullKeyword) {
11011101
// We must add a temporary declaration for the extends clause expression
11021102

1103-
const newId = createOptimisticUniqueName(`${unescapeLeadingUnderscores(input.name!.escapedText)}_base`); // TODO: GH#18217
1103+
const oldId = input.name ? unescapeLeadingUnderscores(input.name.escapedText) : "default";
1104+
const newId = createOptimisticUniqueName(`${oldId}_base`);
11041105
getSymbolAccessibilityDiagnostic = () => ({
11051106
diagnosticMessage: Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
11061107
errorNode: extendsClause,

0 commit comments

Comments
 (0)