diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index fc23222eb520b..5f71f8d4b022e 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -283,6 +283,7 @@ import { SpreadElement, Statement, StringLiteral, + stringToToken, SuperExpression, SwitchStatement, Symbol, @@ -2419,14 +2420,19 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { !(node.flags & NodeFlags.JSDoc) && !isIdentifierName(node)) { + const originalKeywordKind = stringToToken(node.escapedText as string); + if (originalKeywordKind === undefined) { + return; + } + // strict mode identifiers if (inStrictMode && - node.originalKeywordKind! >= SyntaxKind.FirstFutureReservedWord && - node.originalKeywordKind! <= SyntaxKind.LastFutureReservedWord) { + originalKeywordKind >= SyntaxKind.FirstFutureReservedWord && + originalKeywordKind <= SyntaxKind.LastFutureReservedWord) { file.bindDiagnostics.push(createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), declarationNameToString(node))); } - else if (node.originalKeywordKind === SyntaxKind.AwaitKeyword) { + else if (originalKeywordKind === SyntaxKind.AwaitKeyword) { if (isExternalModule(file) && isInTopLevelContext(node)) { file.bindDiagnostics.push(createDiagnosticForNode(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, @@ -2438,7 +2444,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { declarationNameToString(node))); } } - else if (node.originalKeywordKind === SyntaxKind.YieldKeyword && node.flags & NodeFlags.YieldContext) { + else if (originalKeywordKind === SyntaxKind.YieldKeyword && node.flags & NodeFlags.YieldContext) { file.bindDiagnostics.push(createDiagnosticForNode(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node))); @@ -2739,14 +2745,14 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { bindBlockScopedDeclaration(parentNode as Declaration, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes); break; } + checkContextualIdentifier(node as Identifier); // falls through case SyntaxKind.ThisKeyword: // TODO: Why use `isExpression` here? both Identifier and ThisKeyword are expressions. if (currentFlow && (isExpression(node) || parent.kind === SyntaxKind.ShorthandPropertyAssignment)) { (node as Identifier | ThisExpression).flowNode = currentFlow; } - // TODO: a `ThisExpression` is not an Identifier, this cast is unsound - return checkContextualIdentifier(node as Identifier); + break; case SyntaxKind.QualifiedName: if (currentFlow && isPartOfTypeQuery(node)) { (node as QualifiedName).flowNode = currentFlow; diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7a9572c993c51..83ff50a90e8ce 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -923,6 +923,7 @@ import { StringLiteralLike, StringLiteralType, StringMappingType, + stringToToken, stripQuotes, StructuredType, SubstitutionType, @@ -23117,11 +23118,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { break; case SyntaxKind.Parameter: const param = declaration as ParameterDeclaration; + let keywordKind: SyntaxKind | undefined; if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(param, param.name.escapedText, SymbolFlags.Type, undefined, param.name.escapedText, /*isUse*/ true) || - param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) { + (keywordKind = stringToToken(param.name.escapedText as string)) && isTypeNodeKind(keywordKind)) + ) { const newName = "arg" + param.parent.parameters.indexOf(param); const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); @@ -46687,7 +46690,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function checkGrammarNameInLetOrConstDeclarations(name: Identifier | BindingPattern): boolean { if (name.kind === SyntaxKind.Identifier) { - if (name.originalKeywordKind === SyntaxKind.LetKeyword) { + if (name.escapedText === "let") { return grammarErrorOnNode(name, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts index 7b874d33be848..ff8b5007080f0 100644 --- a/src/compiler/factory/nodeFactory.ts +++ b/src/compiler/factory/nodeFactory.ts @@ -407,7 +407,6 @@ import { startsWith, Statement, StringLiteral, - stringToToken, SuperExpression, SwitchStatement, SyntaxKind, @@ -1150,16 +1149,15 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode // Identifiers // - function createBaseIdentifier(escapedText: __String, originalKeywordKind: SyntaxKind | undefined) { + function createBaseIdentifier(escapedText: __String) { const node = baseFactory.createBaseIdentifierNode(SyntaxKind.Identifier) as Mutable; - node.originalKeywordKind = originalKeywordKind; node.escapedText = escapedText; node.autoGenerateFlags = GeneratedIdentifierFlags.None; return node; } function createBaseGeneratedIdentifier(text: string, autoGenerateFlags: GeneratedIdentifierFlags, prefix: string | GeneratedNamePart | undefined, suffix: string | undefined) { - const node = createBaseIdentifier(escapeLeadingUnderscores(text), /*originalKeywordKind*/ undefined) as Mutable; + const node = createBaseIdentifier(escapeLeadingUnderscores(text)) as Mutable; node.autoGenerateFlags = autoGenerateFlags; node.autoGenerateId = nextAutoGenerateId; node.autoGeneratePrefix = prefix; @@ -1168,16 +1166,17 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode return node; } - // @api - function createIdentifier(text: string, typeArguments?: readonly (TypeNode | TypeParameterDeclaration)[], originalKeywordKind?: SyntaxKind, hasExtendedUnicodeEscape?: boolean): Identifier { - if (originalKeywordKind === undefined && text) { - originalKeywordKind = stringToToken(text); - } - if (originalKeywordKind === SyntaxKind.Identifier) { - originalKeywordKind = undefined; - } - - const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind); + /** + * + * @param text + * @param typeArguments + * @param originalKeywordKind ONLY provided by the parser. + * @param hasExtendedUnicodeEscape ONLY provided by the parser. + * @returns + */ + // @api + function createIdentifier(text: string, typeArguments?: readonly (TypeNode | TypeParameterDeclaration)[], originalKeywordKind?: SyntaxKind, hasExtendedUnicodeEscape?: boolean): Identifier { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); node.typeArguments = asNodeArray(typeArguments); node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; node.jsDoc = undefined; // initialized by parser (JsDocContainer) @@ -1186,7 +1185,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode node.symbol = undefined!; // initialized by checker // NOTE: we do not include transform flags of typeArguments in an identifier as they do not contribute to transformations - if (node.originalKeywordKind === SyntaxKind.AwaitKeyword) { + if (originalKeywordKind === SyntaxKind.AwaitKeyword) { node.transformFlags |= TransformFlags.ContainsPossibleTopLevelAwait; } if (node.hasExtendedUnicodeEscape) { @@ -6372,7 +6371,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode } function cloneGeneratedIdentifier(node: GeneratedIdentifier): GeneratedIdentifier { - const clone = createBaseIdentifier(node.escapedText, /*originalKeywordKind*/ undefined) as Mutable; + const clone = createBaseIdentifier(node.escapedText) as Mutable; clone.flags |= node.flags & ~NodeFlags.Synthesized; clone.autoGenerateFlags = node.autoGenerateFlags; clone.autoGenerateId = node.autoGenerateId; @@ -6384,7 +6383,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode } function cloneIdentifier(node: Identifier): Identifier { - const clone = createBaseIdentifier(node.escapedText, node.originalKeywordKind); + const clone = createBaseIdentifier(node.escapedText); clone.flags |= node.flags & ~NodeFlags.Synthesized; clone.typeArguments = node.typeArguments; clone.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape; diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index b7c335f09efb6..b7de4746afabf 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3194,7 +3194,7 @@ namespace Parser { // into an actual .ConstructorDeclaration. const methodDeclaration = node as MethodDeclaration; const nameIsConstructor = methodDeclaration.name.kind === SyntaxKind.Identifier && - methodDeclaration.name.originalKeywordKind === SyntaxKind.ConstructorKeyword; + methodDeclaration.name.escapedText === "constructor"; return !nameIsConstructor; } diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index ab5ea56408a4c..1cca7dfa467fd 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -105,7 +105,6 @@ import { isHoistedFunction, isHoistedVariableStatement, isIdentifier, - isIdentifierANonContextualKeyword, isIfStatement, isInternalName, isIterationStatement, @@ -122,6 +121,7 @@ import { isSpreadElement, isStatement, isStatic, + isStringANonContextualKeyword, isSuperProperty, isSwitchStatement, isTryStatement, @@ -1074,7 +1074,7 @@ export function transformES2015(context: TransformationContext): (x: SourceFile function transformClassBody(node: ClassExpression | ClassDeclaration, extendsClauseElement: ExpressionWithTypeArguments | undefined): Block { const statements: Statement[] = []; const name = factory.getInternalName(node); - const constructorLikeName = isIdentifierANonContextualKeyword(name) ? factory.getGeneratedNameForNode(name) : name; + const constructorLikeName = isStringANonContextualKeyword(idText(name)) ? factory.getGeneratedNameForNode(name) : name; startLexicalEnvironment(); addExtendsHelperIfNeeded(statements, node, extendsClauseElement); addConstructor(statements, node, constructorLikeName, extendsClauseElement); diff --git a/src/compiler/transformers/es5.ts b/src/compiler/transformers/es5.ts index 199cfa582327e..25bc8fabb905d 100644 --- a/src/compiler/transformers/es5.ts +++ b/src/compiler/transformers/es5.ts @@ -5,7 +5,6 @@ import { Expression, getOriginalNodeId, Identifier, - idText, isIdentifier, isPrivateIdentifier, isPropertyAccessExpression, @@ -15,7 +14,6 @@ import { JsxOpeningElement, JsxSelfClosingElement, Node, - nodeIsSynthesized, PropertyAccessExpression, PropertyAssignment, setTextRange, @@ -139,7 +137,7 @@ export function transformES5(context: TransformationContext): (x: SourceFile | B * @param name An Identifier */ function trySubstituteReservedName(name: Identifier) { - const token = name.originalKeywordKind || (nodeIsSynthesized(name) ? stringToToken(idText(name)) : undefined); + const token = stringToToken(name.escapedText as string); if (token !== undefined && token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord) { return setTextRange(factory.createStringLiteralFromNode(name), name); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 22c785897f60c..99df960f6cd1c 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1677,7 +1677,6 @@ export interface Identifier extends PrimaryExpression, Declaration, JSDocContain * Text of identifier, but if the identifier begins with two underscores, this will begin with three. */ readonly escapedText: __String; - readonly originalKeywordKind?: SyntaxKind; // Original syntaxKind which get set so that we can report an error later /** @internal */ readonly autoGenerateFlags?: GeneratedIdentifierFlags; // Specifies whether to auto-generate the text for an identifier. /** @internal */ readonly autoGenerateId?: number; // Ensures unique generated identifiers get unique names, but clones get the same name. /** @internal */ readonly autoGeneratePrefix?: string | GeneratedNamePart; @@ -1686,6 +1685,9 @@ export interface Identifier extends PrimaryExpression, Declaration, JSDocContain isInJSDocNamespace?: boolean; // if the node is a member in a JSDoc namespace /** @internal */ typeArguments?: NodeArray; // Only defined on synthesized nodes. Though not syntactically valid, used in emitting diagnostics, quickinfo, and signature help. /** @internal */ jsdocDotPos?: number; // Identifier occurs in JSDoc-style generic: Id. + /** + * @deprecated `originalKeywordKind` will be removed in the future. + */ readonly originalKeywordKind?: SyntaxKind; /**@internal*/ hasExtendedUnicodeEscape?: boolean; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 826f6e663b2ff..e470fcfd0562a 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -4340,11 +4340,6 @@ export function isStringAKeyword(name: string) { return token !== undefined && isKeyword(token); } -/** @internal */ -export function isIdentifierANonContextualKeyword({ originalKeywordKind }: Identifier): boolean { - return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind); -} - /** @internal */ export function isTrivia(token: SyntaxKind): token is TriviaSyntaxKind { return SyntaxKind.FirstTriviaToken <= token && token <= SyntaxKind.LastTriviaToken; @@ -5709,7 +5704,7 @@ export function isThisInTypeQuery(node: Node): boolean { /** @internal */ export function identifierIsThisKeyword(id: Identifier): boolean { - return id.originalKeywordKind === SyntaxKind.ThisKeyword; + return id.escapedText === "this"; } /** @internal */ @@ -7322,6 +7317,12 @@ function Identifier(this: Mutable, kind: SyntaxKind, pos: number, end: num (this as Identifier).flowNode = undefined; } +Object.defineProperty(Identifier.prototype, "originalKeywordKind" satisfies keyof Identifier, { + get(this: Identifier) { + return stringToToken(this.escapedText as string); + } +}); + function SourceMapSource(this: SourceMapSource, fileName: string, text: string, skipTrivia?: (pos: number) => number) { this.fileName = fileName; this.text = text; diff --git a/src/harness/harnessUtils.ts b/src/harness/harnessUtils.ts index 0946eaa802c83..34987ad9c5977 100644 --- a/src/harness/harnessUtils.ts +++ b/src/harness/harnessUtils.ts @@ -206,15 +206,10 @@ export function sourceFileToJSON(file: ts.Node): string { break; case "hasExtendedUnicodeEscape": - if ((n as any).hasExtendedUnicodeEscape) { + if ((n as ts.Identifier | ts.LiteralLikeNode).hasExtendedUnicodeEscape) { o.hasExtendedUnicodeEscape = true; } break; - - case "originalKeywordKind": - o[propertyName] = getKindName((n as any)[propertyName]); - break; - case "flags": // Clear the flags that are produced by aggregating child values. That is ephemeral // data we don't care about in the dump. We only care what the parser set directly diff --git a/src/services/codefixes/convertToEsModule.ts b/src/services/codefixes/convertToEsModule.ts index 959b9ea4538ad..7e92e1e45a8fb 100644 --- a/src/services/codefixes/convertToEsModule.ts +++ b/src/services/codefixes/convertToEsModule.ts @@ -50,10 +50,10 @@ import { isExportsOrModuleExportsOrAlias, isFunctionExpression, isIdentifier, - isNonContextualKeyword, isObjectLiteralExpression, isPropertyAccessExpression, isRequireCall, + isStringANonContextualKeyword, isVariableStatement, makeImport, map, @@ -161,9 +161,8 @@ type ExportRenames = ReadonlyMap; function collectExportRenames(sourceFile: SourceFile, checker: TypeChecker, identifiers: Identifiers): ExportRenames { const res = new Map(); forEachExportReference(sourceFile, node => { - const { text, originalKeywordKind } = node.name; - if (!res.has(text) && (originalKeywordKind !== undefined && isNonContextualKeyword(originalKeywordKind) - || checker.resolveName(text, node, SymbolFlags.Value, /*excludeGlobals*/ true))) { + const text = node.name.text; + if (!res.has(text) && (isStringANonContextualKeyword(text) || checker.resolveName(text, node, SymbolFlags.Value, /*excludeGlobals*/ true))) { // Unconditionally add an underscore in case `text` is a keyword. res.set(text, makeUniqueName(`_${text}`, identifiers)); } diff --git a/src/services/completions.ts b/src/services/completions.ts index 45c25e900c2ce..0cb6475de5469 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -217,6 +217,7 @@ import { isStatement, isStatic, isString, + isStringAKeyword, isStringANonContextualKeyword, isStringLiteralLike, isStringLiteralOrTemplate, @@ -1690,8 +1691,11 @@ function isModifierLike(node: Node): ModifierSyntaxKind | undefined { if (isModifier(node)) { return node.kind; } - if (isIdentifier(node) && node.originalKeywordKind && isModifierKind(node.originalKeywordKind)) { - return node.originalKeywordKind; + if (isIdentifier(node)) { + const keywordKind = stringToToken(node.text); + if (keywordKind && isModifierKind(keywordKind)) { + return keywordKind; + } } return undefined; } @@ -4720,7 +4724,7 @@ function isFunctionLikeBodyKeyword(kind: SyntaxKind) { } function keywordForNode(node: Node): SyntaxKind { - return isIdentifier(node) ? node.originalKeywordKind || SyntaxKind.Unknown : node.kind; + return isIdentifier(node) ? stringToToken(node.text) ?? SyntaxKind.Unknown : node.kind; } function getContextualKeywords( @@ -4824,8 +4828,7 @@ function tryGetObjectTypeDeclarationCompletionContainer(sourceFile: SourceFile, } break; case SyntaxKind.Identifier: { - const originalKeywordKind = (location as Identifier).originalKeywordKind; - if (originalKeywordKind && isKeyword(originalKeywordKind)) { + if (isStringAKeyword((location as Identifier).text)) { return undefined; } // class c { public prop = c| } diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 01ad83b784169..e4abab149ed6e 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -1940,8 +1940,8 @@ export namespace Core { // For `export { foo as bar }`, rename `foo`, but not `bar`. if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) { - const isDefaultExport = referenceLocation.originalKeywordKind === SyntaxKind.DefaultKeyword - || exportSpecifier.name.originalKeywordKind === SyntaxKind.DefaultKeyword; + const isDefaultExport = referenceLocation.text === "default" + || exportSpecifier.name.text === "default"; const exportKind = isDefaultExport ? ExportKind.Default : ExportKind.Named; const exportSymbol = Debug.checkDefined(exportSpecifier.symbol); const exportInfo = getExportInfo(exportSymbol, exportKind, state.checker); diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 45aa5d1b90970..8a6cb4acb99a7 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -87,7 +87,6 @@ import { isJsxElement, isJsxFragment, isJsxSelfClosingElement, - isKeyword, isModuleBlock, isParenthesizedTypeNode, isPartOfTypeNode, @@ -100,6 +99,7 @@ import { isSourceFile, isStatement, isStatic, + isStringAKeyword, isStringLiteral, isSwitchStatement, isThis, @@ -1351,7 +1351,7 @@ function extractConstantInScope( // Make a unique name for the extracted variable const file = scope.getSourceFile(); - const localNameText = isPropertyAccessExpression(node) && !isClassLike(scope) && !checker.resolveName(node.name.text, node, SymbolFlags.Value, /*excludeGlobals*/ false) && !isPrivateIdentifier(node.name) && !isKeyword(node.name.originalKeywordKind!) + const localNameText = isPropertyAccessExpression(node) && !isClassLike(scope) && !checker.resolveName(node.name.text, node, SymbolFlags.Value, /*excludeGlobals*/ false) && !isPrivateIdentifier(node.name) && !isStringAKeyword(node.name.text) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file); const isJS = isInJSFile(scope); diff --git a/src/services/rename.ts b/src/services/rename.ts index 52ee0b8a3f544..f8b6971e6b37d 100644 --- a/src/services/rename.ts +++ b/src/services/rename.ts @@ -97,7 +97,7 @@ function getRenameInfoForNode( } // Cannot rename `default` as in `import { default as foo } from "./someModule"; - if (isIdentifier(node) && node.originalKeywordKind === SyntaxKind.DefaultKeyword && symbol.parent && symbol.parent.flags & SymbolFlags.Module) { + if (isIdentifier(node) && node.escapedText === "default" && symbol.parent && symbol.parent.flags & SymbolFlags.Module) { return undefined; } diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.@@ does not start a new tag.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.@@ does not start a new tag.json index dca1bc102db2a..362e7f146a6ac 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.@@ does not start a new tag.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.@@ does not start a new tag.json @@ -27,7 +27,6 @@ "end": 18, "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "ThisKeyword", "escapedText": "this" }, "isNameFirst": true, diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.leadingAsterisk.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.leadingAsterisk.json index 8d57b3d79ab77..3269bdc87fc04 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.leadingAsterisk.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.leadingAsterisk.json @@ -18,7 +18,6 @@ "end": 13, "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "TypeKeyword", "escapedText": "type" }, "typeExpression": { diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.no space before @ is not a new tag.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.no space before @ is not a new tag.json index 64de20d9bef39..87597fad44e4c 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.no space before @ is not a new tag.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.no space before @ is not a new tag.json @@ -27,7 +27,6 @@ "end": 18, "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "ThisKeyword", "escapedText": "this" }, "isNameFirst": true, diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noLeadingAsterisk.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noLeadingAsterisk.json index 8d57b3d79ab77..3269bdc87fc04 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noLeadingAsterisk.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noLeadingAsterisk.json @@ -18,7 +18,6 @@ "end": 13, "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "TypeKeyword", "escapedText": "type" }, "typeExpression": { diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noReturnType.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noReturnType.json index ad2eea3f2d5c3..ab21f32ef9c61 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noReturnType.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noReturnType.json @@ -18,7 +18,6 @@ "end": 15, "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "ReturnKeyword", "escapedText": "return" } }, diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.returnTag1.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.returnTag1.json index 00e574a12c499..a3abbded8b07a 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.returnTag1.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.returnTag1.json @@ -18,7 +18,6 @@ "end": 15, "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "ReturnKeyword", "escapedText": "return" }, "typeExpression": { diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.returnTag2.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.returnTag2.json index 7fb31fbd96d6a..474aa807f2be6 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.returnTag2.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.returnTag2.json @@ -18,7 +18,6 @@ "end": 15, "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "ReturnKeyword", "escapedText": "return" }, "comment": "Description text follows", diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.typeTag.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.typeTag.json index 8d57b3d79ab77..3269bdc87fc04 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.typeTag.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.typeTag.json @@ -18,7 +18,6 @@ "end": 13, "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "TypeKeyword", "escapedText": "type" }, "typeExpression": { diff --git a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.keyword1.json b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.keyword1.json index 4dbd3f2959bf8..24e3d75cd7f88 100644 --- a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.keyword1.json +++ b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.keyword1.json @@ -12,7 +12,6 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "VarKeyword", "escapedText": "var" } } \ No newline at end of file diff --git a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.newType1.json b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.newType1.json index 070cfdabde5dd..9e76619c596bd 100644 --- a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.newType1.json +++ b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.newType1.json @@ -20,7 +20,6 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "NewKeyword", "escapedText": "new" }, "type": { diff --git a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.recordType8.json b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.recordType8.json index 780a7289bd51c..5a970882d3d7f 100644 --- a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.recordType8.json +++ b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.recordType8.json @@ -20,7 +20,6 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "FunctionKeyword", "escapedText": "function" } }, diff --git a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.thisType1.json b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.thisType1.json index 2f189e79ae3a0..a03b17581eb67 100644 --- a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.thisType1.json +++ b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.thisType1.json @@ -20,7 +20,6 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "ThisKeyword", "escapedText": "this" }, "type": { diff --git a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.typeReference3.json b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.typeReference3.json index 5dde38b4c0b07..3c5435032afdb 100644 --- a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.typeReference3.json +++ b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.typeReference3.json @@ -28,7 +28,6 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "originalKeywordKind": "FunctionKeyword", "escapedText": "function" } } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index c314e60dcbf84..422409b700384 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -4599,7 +4599,6 @@ declare namespace ts { * Text of identifier, but if the identifier begins with two underscores, this will begin with three. */ readonly escapedText: __String; - readonly originalKeywordKind?: SyntaxKind; isInJSDocNamespace?: boolean; } interface Identifier { diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 8f15e1cae0f9c..a58ba0c820384 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -664,7 +664,6 @@ declare namespace ts { * Text of identifier, but if the identifier begins with two underscores, this will begin with three. */ readonly escapedText: __String; - readonly originalKeywordKind?: SyntaxKind; isInJSDocNamespace?: boolean; } interface Identifier {