Skip to content

Commit 422b541

Browse files
committed
Allow synthetic identifiers to exist and give them escapedText
1 parent 907664c commit 422b541

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/services/services.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,11 @@ namespace ts {
172172
const token = scanner.scan();
173173
const textPos = scanner.getTextPos();
174174
if (textPos <= end) {
175-
if (token === SyntaxKind.Identifier) {
176-
Debug.fail(`Did not expect ${Debug.showSyntaxKind(parent)} to have an Identifier in its trivia`);
175+
const node = createNode(token, pos, textPos, parent);
176+
nodes.push(node);
177+
if (isIdentifier(node)) {
178+
node.escapedText = escapeLeadingUnderscores(scanner.getTokenValue());
177179
}
178-
nodes.push(createNode(token, pos, textPos, parent));
179180
}
180181
pos = textPos;
181182
if (token === SyntaxKind.EndOfFileToken) {

0 commit comments

Comments
 (0)