diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index ca41554256a03..9eddd645de424 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -302,9 +302,12 @@ const regExpFlagToFirstAvailableLanguageVersion = new Map(); for (let i = 0; i < CharacterCodes.maxAsciiCharacter; i++) { - tokenCategoryLookup.push(TokenCategory.None); + tokenCategoryLookup.push(TokenCategory.IdentifierOrUnknown); } for ( @@ -2027,9 +2030,9 @@ export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean const tokenCategory = ch < tokenCategoryLookup.length ? tokenCategoryLookup[ch] : - tokenCategoryLookupUncommon.get(ch) ?? TokenCategory.None; + tokenCategoryLookupUncommon.get(ch) ?? TokenCategory.IdentifierOrUnknown; - if (tokenCategory === TokenCategory.None) { + if (tokenCategory === TokenCategory.IdentifierOrUnknown) { const identifierKind = scanIdentifier(ch, languageVersion); if (identifierKind) { return token = identifierKind;