mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-25 05:29:07 -05:00
fix(45114): throw an error when using '#' as an identifier (#45124)
This commit is contained in:
@@ -2047,8 +2047,15 @@ namespace ts {
|
||||
pos++;
|
||||
return token = SyntaxKind.Unknown;
|
||||
}
|
||||
pos++;
|
||||
scanIdentifier(codePointAt(text, pos), languageVersion);
|
||||
|
||||
if (isIdentifierStart(codePointAt(text, pos + 1), languageVersion)) {
|
||||
pos++;
|
||||
scanIdentifier(codePointAt(text, pos), languageVersion);
|
||||
}
|
||||
else {
|
||||
tokenValue = String.fromCharCode(codePointAt(text, pos));
|
||||
error(Diagnostics.Invalid_character, pos++, charSize(ch));
|
||||
}
|
||||
return token = SyntaxKind.PrivateIdentifier;
|
||||
default:
|
||||
const identifierKind = scanIdentifier(ch, languageVersion);
|
||||
|
||||
Reference in New Issue
Block a user