Allow synthetic identifiers to exist and give them escapedText

This commit is contained in:
Andrew Branch
2019-05-20 12:02:52 -07:00
parent 907664c31c
commit 422b5414f1

View File

@@ -172,10 +172,11 @@ namespace ts {
const token = scanner.scan();
const textPos = scanner.getTextPos();
if (textPos <= end) {
if (token === SyntaxKind.Identifier) {
Debug.fail(`Did not expect ${Debug.showSyntaxKind(parent)} to have an Identifier in its trivia`);
const node = createNode(token, pos, textPos, parent);
nodes.push(node);
if (isIdentifier(node)) {
node.escapedText = escapeLeadingUnderscores(scanner.getTokenValue());
}
nodes.push(createNode(token, pos, textPos, parent));
}
pos = textPos;
if (token === SyntaxKind.EndOfFileToken) {