mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-15 22:15:05 -05:00
Allow synthetic identifiers to exist and give them escapedText
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user