mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
Private identifiers use standard identifier scanning (#44184)
* Private identifiers use standard identifer scanning Previously they used an old copy of the identifier scanning code that didn't handle extended unicode yet. * gotta fix that const lint
This commit is contained in:
committed by
GitHub
parent
4ce12f9f65
commit
71cdf6a920
@@ -1610,7 +1610,7 @@ namespace ts {
|
||||
if (pos >= end) {
|
||||
return token = SyntaxKind.EndOfFileToken;
|
||||
}
|
||||
let ch = codePointAt(text, pos);
|
||||
const ch = codePointAt(text, pos);
|
||||
|
||||
// Special handling for shebang
|
||||
if (ch === CharacterCodes.hash && pos === 0 && isShebangTrivia(text, pos)) {
|
||||
@@ -2044,18 +2044,7 @@ namespace ts {
|
||||
return token = SyntaxKind.Unknown;
|
||||
}
|
||||
pos++;
|
||||
if (isIdentifierStart(ch = text.charCodeAt(pos), languageVersion)) {
|
||||
pos++;
|
||||
while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos), languageVersion)) pos++;
|
||||
tokenValue = text.substring(tokenPos, pos);
|
||||
if (ch === CharacterCodes.backslash) {
|
||||
tokenValue += scanIdentifierParts();
|
||||
}
|
||||
}
|
||||
else {
|
||||
tokenValue = "#";
|
||||
error(Diagnostics.Invalid_character);
|
||||
}
|
||||
scanIdentifier(codePointAt(text, pos), languageVersion);
|
||||
return token = SyntaxKind.PrivateIdentifier;
|
||||
default:
|
||||
const identifierKind = scanIdentifier(ch, languageVersion);
|
||||
|
||||
Reference in New Issue
Block a user