Skip to content

Commit 884cadf

Browse files
author
Francois Wouts
committed
Fix TypeScript printer bug when encountering regular expression literals
See https://github.com/fwouts/sample-js-selfparsing/blob/typescriptbug/src/script.js to reproduce the bug. Not sure where to put tests for this, unfortunately!
1 parent a32d99d commit 884cadf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/compiler/utilities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ namespace ts {
359359
case SyntaxKind.TemplateTail:
360360
return "}" + escapeText(node.text, CharacterCodes.backtick) + "`";
361361
case SyntaxKind.NumericLiteral:
362+
case SyntaxKind.RegularExpressionLiteral:
362363
return node.text;
363364
}
364365

0 commit comments

Comments
 (0)