File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2281,7 +2281,7 @@ namespace ts {
2281
2281
2282
2282
function parsePrivateIdentifier(): PrivateIdentifier {
2283
2283
const pos = getNodePos();
2284
- const node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenText ()));
2284
+ const node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenValue ()));
2285
2285
nextToken();
2286
2286
return finishNode(node, pos);
2287
2287
}
Original file line number Diff line number Diff line change @@ -2054,6 +2054,11 @@ namespace ts {
2054
2054
2055
2055
if ( isIdentifierStart ( codePointAt ( text , pos + 1 ) , languageVersion ) ) {
2056
2056
pos ++ ;
2057
+ // We're relying on scanIdentifier's behavior and adjusting the token kind after the fact.
2058
+ // Notably absent from this block is the fact that calling a function named "scanIdentifier",
2059
+ // but identifiers don't include '#', and that function doesn't deal with it at all.
2060
+ // This works because 'scanIdentifier' tries to reuse source characters and builds up substrings;
2061
+ // however, it starts at the 'tokenPos' which includes the '#', and will "accidentally" prepend the '#' for us.
2057
2062
scanIdentifier ( codePointAt ( text , pos ) , languageVersion ) ;
2058
2063
}
2059
2064
else {
You can’t perform that action at this time.
0 commit comments