Skip to content

Commit

Permalink
fix externs from class methods with special chars, see theseanl/tscc#855
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianLeishman committed Sep 3, 2024
1 parent eddd2b8 commit feab335
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/externs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export function generateExterns(
if (name.kind === ts.SyntaxKind.Identifier) {
fqn += '.'; // computed names include [ ] in their getText() representation.
}
fqn += name.getText();
fqn += name.getText().replace(/[^$_\w\d]/g, '_');
emit(`${fqn} = function(${paramsStr}) {};\n`);
} else {
if (name.kind !== ts.SyntaxKind.Identifier) {
Expand Down

0 comments on commit feab335

Please sign in to comment.